Struct riven::RiotApi [−][src]
pub struct RiotApi { /* fields omitted */ }
Expand description
For retrieving data from the Riot Games API.
Usage
Construct an instance using with_key(api_key)
or
with_config(config)
.
An instance provides access to “endpoint handles” which in turn provide access to individual API method calls. For example, getting a summoner by name:
riot_api.summoner_v4().get_by_summoner_name(Region::NA, "LugnutsK")
Rate Limiting
The Riot Game API enforces dynamic rate limiting, meaning that rate limits are specified in response headers and (theoretically) could change at any time. Riven keeps track of changing rate limits seamlessly, preventing you from getting blacklisted.
Riven’s rate limiting is highly efficient, meaning that it can reach the limits of your rate limit without going over.
To adjust rate limiting, see RiotApiConfig and use
with_config(config)
to construct an instance.
Implementations
Returns a handle for accessing AccountV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing ChampionMasteryV4 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing ChampionV3 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing ClashV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing LeagueExpV4 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing LeagueV4 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing LolStatusV3 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing LolStatusV4 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing LorDeckV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing LorInventoryV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing LorMatchV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing LorRankedV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing LorStatusV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing MatchV4 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing MatchV5 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing SpectatorV4 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing SummonerV4 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing TftLeagueV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing TftMatchV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing TftSummonerV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing ThirdPartyCodeV4 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing TournamentStubV4 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing TournamentV4 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing ValContentV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing ValMatchV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing ValRankedV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Returns a handle for accessing ValStatusV1 endpoints.
Riot Developer API Reference
Note: this method is automatically generated.
Constructs a new instance from the given RiotApiConfig, consuming it.
Constructs a new instance from the given API key, using default configuration.
api_key
should be a Riot Games API key from
https://developer.riotgames.com/,
and should look like "RGAPI-01234567-89ab-cdef-0123-456789abcdef"
.
pub async fn get_optional<'a, T: DeserializeOwned + 'a>(
&'a self,
method_id: &'static str,
region_platform: &'static str,
path: String,
query: Option<String>
) -> Result<Option<T>>
pub async fn get_optional<'a, T: DeserializeOwned + 'a>(
&'a self,
method_id: &'static str,
region_platform: &'static str,
path: String,
query: Option<String>
) -> Result<Option<T>>
This method is not meant to be used directly.
This sends a GET request based on the given parameters and returns an optional parsed result.
Parameters
method_id
- A unique string id representing the endpoint method for per-method rate limiting.region_platform
- The stringified platform, prepended to.api.riotgames.com
to create the hostname.path
- The path relative to the hostname.query
- An optional query string.
Returns
A future resolving to a Result
containg either a Option<T>
(success) or a RiotApiError
(failure).
This method is not meant to be used directly.
This sends a GET request based on the given parameters and returns a parsed result.
Parameters
method_id
- A unique string id representing the endpoint method for per-method rate limiting.region_platform
- The stringified platform, prepended to.api.riotgames.com
to create the hostname.path
- The path relative to the hostname.query
- An optional query string.
Returns
A future resolving to a Result
containg either a T
(success) or a RiotApiError
(failure).
pub fn get_raw_response<'a>(
&'a self,
method_id: &'static str,
region_platform: &'static str,
path: String,
query: Option<String>
) -> impl Future<Output = Result<ResponseInfo>> + 'a
pub fn get_raw_response<'a>(
&'a self,
method_id: &'static str,
region_platform: &'static str,
path: String,
query: Option<String>
) -> impl Future<Output = Result<ResponseInfo>> + 'a
This method is not meant to be used directly.
This sends a GET request based on the given parameters and returns a raw ResponseInfo
.
This can be used to implement a Riot API proxy without needing to deserialize and reserialize JSON responses.
Parameters
method_id
- A unique string id representing the endpoint method for per-method rate limiting.region_platform
- The stringified platform, prepended to.api.riotgames.com
to create the hostname.path
- The path relative to the hostname.query
- An optional query string.
Returns
A future resolving to a Result
containg either a ResponseInfo
(success) or a RiotApiError
(failure).
Auto Trait Implementations
impl !RefUnwindSafe for RiotApi
impl !UnwindSafe for RiotApi