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

account-v1

Note: this method is automatically generated.

Returns a handle for accessing ChampionMasteryV4 endpoints.

Riot Developer API Reference

champion-mastery-v4

Note: this method is automatically generated.

Returns a handle for accessing ChampionV3 endpoints.

Riot Developer API Reference

champion-v3

Note: this method is automatically generated.

Returns a handle for accessing ClashV1 endpoints.

Riot Developer API Reference

clash-v1

Note: this method is automatically generated.

Returns a handle for accessing LeagueExpV4 endpoints.

Riot Developer API Reference

league-exp-v4

Note: this method is automatically generated.

Returns a handle for accessing LeagueV4 endpoints.

Riot Developer API Reference

league-v4

Note: this method is automatically generated.

Returns a handle for accessing LolStatusV3 endpoints.

Riot Developer API Reference

lol-status-v3

Note: this method is automatically generated.

Returns a handle for accessing LolStatusV4 endpoints.

Riot Developer API Reference

lol-status-v4

Note: this method is automatically generated.

Returns a handle for accessing LorDeckV1 endpoints.

Riot Developer API Reference

lor-deck-v1

Note: this method is automatically generated.

Returns a handle for accessing LorInventoryV1 endpoints.

Riot Developer API Reference

lor-inventory-v1

Note: this method is automatically generated.

Returns a handle for accessing LorMatchV1 endpoints.

Riot Developer API Reference

lor-match-v1

Note: this method is automatically generated.

Returns a handle for accessing LorRankedV1 endpoints.

Riot Developer API Reference

lor-ranked-v1

Note: this method is automatically generated.

Returns a handle for accessing LorStatusV1 endpoints.

Riot Developer API Reference

lor-status-v1

Note: this method is automatically generated.

Returns a handle for accessing MatchV4 endpoints.

Riot Developer API Reference

match-v4

Note: this method is automatically generated.

Returns a handle for accessing MatchV5 endpoints.

Riot Developer API Reference

match-v5

Note: this method is automatically generated.

Returns a handle for accessing SpectatorV4 endpoints.

Riot Developer API Reference

spectator-v4

Note: this method is automatically generated.

Returns a handle for accessing SummonerV4 endpoints.

Riot Developer API Reference

summoner-v4

Note: this method is automatically generated.

Returns a handle for accessing TftLeagueV1 endpoints.

Riot Developer API Reference

tft-league-v1

Note: this method is automatically generated.

Returns a handle for accessing TftMatchV1 endpoints.

Riot Developer API Reference

tft-match-v1

Note: this method is automatically generated.

Returns a handle for accessing TftSummonerV1 endpoints.

Riot Developer API Reference

tft-summoner-v1

Note: this method is automatically generated.

Returns a handle for accessing ThirdPartyCodeV4 endpoints.

Riot Developer API Reference

third-party-code-v4

Note: this method is automatically generated.

Returns a handle for accessing TournamentStubV4 endpoints.

Riot Developer API Reference

tournament-stub-v4

Note: this method is automatically generated.

Returns a handle for accessing TournamentV4 endpoints.

Riot Developer API Reference

tournament-v4

Note: this method is automatically generated.

Returns a handle for accessing ValContentV1 endpoints.

Riot Developer API Reference

val-content-v1

Note: this method is automatically generated.

Returns a handle for accessing ValMatchV1 endpoints.

Riot Developer API Reference

val-match-v1

Note: this method is automatically generated.

Returns a handle for accessing ValRankedV1 endpoints.

Riot Developer API Reference

val-ranked-v1

Note: this method is automatically generated.

Returns a handle for accessing ValStatusV1 endpoints.

Riot Developer API Reference

val-status-v1

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".

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).

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.