[−][src]Struct narwhalol::api::LeagueClient
Main type for calling League API Endpoints.
Instances of LeagueClient
can be created using new
with a Region
parameter
LeagueClient
can have an embedded DDragonClient
instance embedded in itself,
reference to which can be obtained using ddragon
. NOTE: this method will panic if
you don't create the instance using with_ddragon
.
Implementations
impl LeagueClient
[src]
pub fn new(region: Region) -> Result<LeagueClient, ClientError>
[src]
Constructor function for LeagueAPI struct, accepts type as a parameter
Panics
This will panic if you do not provide the RIOT_API_KEY environment variable with value being api token.
pub async fn with_ddragon(self, language: LanguageCode) -> Self
[src]
Adds an embedded ddragon client instance to league api client that shares cache and client with parent.
pub fn ddragon(&mut self) -> &mut DDragonClient
[src]
Gets mutable (because of cache) reference to ddragon client embedded in lapi client.
Panics
Do not call ddragon
if with_ddragon
is not called beforehand.
pub async fn get_summoner_by_name<'_, '_>(
&'_ self,
name: &'_ str
) -> Result<Summoner, ClientError>
[src]
&'_ self,
name: &'_ str
) -> Result<Summoner, ClientError>
Get summoner by plaintext name
Example
use narwhalol::{LeagueClient, Region, dto::api::Summoner, error::ClientError}; fn main() -> Result<(), ClientError> { smol::run(async { let mut lapi = LeagueClient::new(Region::RU).unwrap(); let summoner = lapi.get_summoner_by_name("Vetro").await?; assert_eq!(summoner.name, "Vetro"); Ok(()) }) }
pub async fn get_champion_info<'_>(
&'_ mut self
) -> Result<ChampionInfo, ClientError>
[src]
&'_ mut self
) -> Result<ChampionInfo, ClientError>
pub async fn get_champion_masteries<'_, '_>(
&'_ mut self,
summoner_id: &'_ str
) -> Result<Vec<ChampionMastery>, ClientError>
[src]
&'_ mut self,
summoner_id: &'_ str
) -> Result<Vec<ChampionMastery>, ClientError>
pub async fn get_champion_mastery_by_id<'_, '_>(
&'_ mut self,
summoner_id: &'_ str,
champion_id: u64
) -> Result<ChampionMastery, ClientError>
[src]
&'_ mut self,
summoner_id: &'_ str,
champion_id: u64
) -> Result<ChampionMastery, ClientError>
pub async fn get_total_mastery_score<'_, '_>(
&'_ mut self,
summoner_id: &'_ str
) -> Result<i32, ClientError>
[src]
&'_ mut self,
summoner_id: &'_ str
) -> Result<i32, ClientError>
pub async fn get_league_exp_entries<'_>(
&'_ mut self,
queue: RankedQueue,
tier: RankedTier,
division: Division,
pages: Option<i32>
) -> Result<Vec<LeagueInfo>, ClientError>
[src]
&'_ mut self,
queue: RankedQueue,
tier: RankedTier,
division: Division,
pages: Option<i32>
) -> Result<Vec<LeagueInfo>, ClientError>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for LeagueClient
impl Send for LeagueClient
impl Sync for LeagueClient
impl Unpin for LeagueClient
impl !UnwindSafe for LeagueClient
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,