Expand description
Client library for the Toornament web API.
Log in to Toornament with Toornament::with_application
.
Call API methods to interact with the service directly or user an iterator-like interface to
work with it in more rust-idiomatic way.
For Toornament API documentation [look here] (https://developer.toornament.com/overview/get-started).
For examples, see the examples
directory in the source tree.
For more readings, look at the toornament-rs book
.
§Usage
Start by creating and instance Toornament
structure and then perform the requests:
use toornament::*;
let toornament = Toornament::with_application("API_TOKEN",
"CLIENT_ID",
"CLIENT_SECRET").unwrap();
println!("Disciplines: {:?}", toornament.disciplines(None));
println!("Disciplines: {:?}", toornament.disciplines_iter()
.all()
.collect::<Disciplines>());
§Additional notes
The Toornament
structure is Send
and Sync
, so it can be simply shared among
threads. Also, the Toornament
objects may live as long as you need to: the object will
refresh it’s access token once it is expired, so you may just create it once and use
everywhere.
Re-exports§
pub use iter::*;
Modules§
- info
- This module gives the build and version information about the library.
- iter
- This module introduces iterator-like interface to the toornament. The content of this module is not really an iterator, it just may look so. It was made to provide an easy and rust-idiomatic way to interact with the service. Note that everything here is “lazy”. Think of it as you use an iterator over remote data.
Structs§
- Additional
Fields - Additional fields for
Discipline
wrap. - Custom
Field - A participant’s custom fields
- Custom
Fields - A list of participant’s custom fields
- Discipline
- A game discipline object.
- Discipline
Id - A game discipline identity.
- Disciplines
- A list of
Discipline
objects. - Game
- A game description.
- Game
Number - A game number.
- Games
- Array of games
- Match
- Tournament or discipline match definition.
- Match
Filter - A filter for match endpoints
- MatchId
- Match unique identificator.
- Match
Result - Result of a match
- Matches
- A list of
Match
objects. - Opponent
- An opponent involved in a match.
- Opponents
- List of the opponents involved in this match.
- Participant
- An opponent involved in a match/tournament.
- Participant
Id - Unique participant identifier
- Participant
Logo - Logo of the participant.
- Participants
- A list of participants
- Permission
- A user permission
- Permission
Attributes - A list of permission attributes
- Permission
Id - Unique permission identity
- Permissions
- A list of permissions
- Stage
- A tournament stage
- Stage
Number - A stage number
- Stages
- A list of tournament stages
- Stream
- A stream object.
- Stream
Id - A stream identity.
- Streams
- A list of
Stream
objects. - Team
Size - Team size bounds (minimum and maximum).
- Toornament
- Main structure. Should be your point of start using the service.
This struct covers all the
toornament
API. - Toornament
Error - A list of toornament service errors
- Toornament
Errors - A list of toornament service errors
- Toornament
Service Error - Toornament service error
- Tournament
- A tournament object.
- Tournament
Id - A tournament identity.
- Tournament
Participants Filter - A filter for tournament participants
- Tournament
Videos Filter - A filter for tournament videos
- Tournaments
- A list of
Tournament
objects. - Video
- A tournament video
- Videos
- A list of tournament videos
Enums§
- Create
Date Sort Filter - Create date sorting filter
- Custom
Field Type - A type of a participant’s custom field
- Date
Sort Filter - Date sorting filter
- Error
- Toornament API error type.
- Iter
Error - Iter errors
- Match
Format - A Match format enumeration.
- Match
Result Simple - Match
Status - A match status.
- Match
Type - A match type enumeration.
- Participant
Type - A participant type enumeration.
- Permission
Attribute - Permission attribute definition
- Stage
Type - Tournament stage type
- Toornament
Error Scope - A toornament service error scope
- Toornament
Error Type - A toornament service error type
- Tournament
Status - A tournament status.
- Video
Category - Tournament video category