forked from mirror/Riven
1
0
Fork 0
Riven/src/riot_api.rs

22 lines
527 B
Rust
Raw Normal View History

2019-10-20 07:54:01 +00:00
use crate::RiotApiConfig;
2019-10-17 23:00:04 +00:00
use crate::req::RequesterManager;
pub struct RiotApi<'a> {
2019-10-19 21:39:53 +00:00
pub requester_manager: RequesterManager<'a>,
_private: (),
2019-10-17 23:00:04 +00:00
}
impl<'a> RiotApi<'a> {
pub fn with_config(config: RiotApiConfig<'a>) -> Self {
2019-10-19 21:39:53 +00:00
let req_man = RequesterManager::new(config);
2019-10-17 23:00:04 +00:00
Self {
2019-10-19 21:39:53 +00:00
requester_manager: req_man,
_private: (),
2019-10-17 23:00:04 +00:00
}
}
pub fn with_key(api_key: &'a str) -> Self {
Self::with_config(RiotApiConfig::with_key(api_key))
}
}