Struct shaco::ingame::IngameClient
source · pub struct IngameClient(_);
Expand description
A client for the LoL-Ingame API
Implementations§
source§impl IngameClient
impl IngameClient
sourcepub fn new() -> Result<Self, IngameClientError>
pub fn new() -> Result<Self, IngameClientError>
Create a new connection to the ingame api. This will return an error if a game is not running
sourcepub async fn active_game(&self) -> bool
pub async fn active_game(&self) -> bool
Checks if there is an active game
Returns true only after the loading screen
sourcepub async fn active_game_loadingscreen(&self) -> bool
pub async fn active_game_loadingscreen(&self) -> bool
Checks if there is an active game
Returns true even in loading screen while other API calls still return Error
sourcepub async fn is_spectator_mode(&self) -> Result<bool, IngameClientError>
pub async fn is_spectator_mode(&self) -> Result<bool, IngameClientError>
Checks if the game is a livegame or in spectatormode
sourcepub async fn all_game_data(
&self,
event_id: Option<u32>
) -> Result<AllGameData, IngameClientError>
pub async fn all_game_data( &self, event_id: Option<u32> ) -> Result<AllGameData, IngameClientError>
Get all current game data
sourcepub async fn event_data(
&self,
event_id: Option<u32>
) -> Result<Vec<GameEvent>, IngameClientError>
pub async fn event_data( &self, event_id: Option<u32> ) -> Result<Vec<GameEvent>, IngameClientError>
Get event data for the active game
sourcepub async fn game_stats(&self) -> Result<GameStats, IngameClientError>
pub async fn game_stats(&self) -> Result<GameStats, IngameClientError>
Get the active games stats
sourcepub async fn player_items<S: AsRef<str>>(
&self,
summoner_name: S
) -> Result<Vec<PlayerItem>, IngameClientError>
pub async fn player_items<S: AsRef<str>>( &self, summoner_name: S ) -> Result<Vec<PlayerItem>, IngameClientError>
Get a specified players items
sourcepub async fn player_list(
&self,
team_id: Option<TeamId>
) -> Result<Vec<Player>, IngameClientError>
pub async fn player_list( &self, team_id: Option<TeamId> ) -> Result<Vec<Player>, IngameClientError>
Get a list of players in game
sourcepub async fn player_main_runes<S: AsRef<str>>(
&self,
summoner_name: S
) -> Result<PlayerRunes, IngameClientError>
pub async fn player_main_runes<S: AsRef<str>>( &self, summoner_name: S ) -> Result<PlayerRunes, IngameClientError>
Get a specified players main runes
sourcepub async fn player_scores<S: AsRef<str>>(
&self,
summoner_name: S
) -> Result<PlayerScores, IngameClientError>
pub async fn player_scores<S: AsRef<str>>( &self, summoner_name: S ) -> Result<PlayerScores, IngameClientError>
Get a specified players score
sourcepub async fn player_summoner_spells<S: AsRef<str>>(
&self,
summoner_name: S
) -> Result<SummonerSpells, IngameClientError>
pub async fn player_summoner_spells<S: AsRef<str>>( &self, summoner_name: S ) -> Result<SummonerSpells, IngameClientError>
Get specified players summoner spells
sourcepub async fn active_player(&self) -> Result<ActivePlayer, IngameClientError>
pub async fn active_player(&self) -> Result<ActivePlayer, IngameClientError>
Get active players data
Only available during livegame
sourcepub async fn active_player_abilities(
&self
) -> Result<PlayerAbilities, IngameClientError>
pub async fn active_player_abilities( &self ) -> Result<PlayerAbilities, IngameClientError>
Get the active players abilities
Only available during livegame
sourcepub async fn active_player_name(&self) -> Result<String, IngameClientError>
pub async fn active_player_name(&self) -> Result<String, IngameClientError>
Get the active players name
Only available during livegame
sourcepub async fn active_player_runes(
&self
) -> Result<FullPlayerRunes, IngameClientError>
pub async fn active_player_runes( &self ) -> Result<FullPlayerRunes, IngameClientError>
Get the active players runes
Only available during livegames