[−][src]Crate toornament
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
AdditionalFields | Additional fields for |
CustomField | A participant's custom fields |
CustomFields | A list of participant's custom fields |
Discipline | A game discipline object. |
DisciplineId | A game discipline identity. |
Disciplines | A list of |
Game | A game description. |
GameNumber | A game number. |
Games | Array of games |
Match | Tournament or discipline match definition. |
MatchFilter | A filter for match endpoints |
MatchId | Match unique identificator. |
MatchResult | Result of a match |
Matches | A list of |
Opponent | An opponent involved in a match. |
Opponents | List of the opponents involved in this match. |
Participant | An opponent involved in a match/tournament. |
ParticipantId | Unique participant identifier |
ParticipantLogo | Logo of the participant. |
Participants | A list of participants |
Permission | A user permission |
PermissionAttributes | A list of permission attributes |
PermissionId | Unique permission identity |
Permissions | A list of permissions |
Stage | A tournament stage |
StageNumber | A stage number |
Stages | A list of tournament stages |
Stream | A stream object. |
StreamId | A stream identity. |
Streams | A list of |
TeamSize | Team size bounds (minimum and maximum). |
Toornament | Main structure. Should be your point of start using the service.
This struct covers all the |
ToornamentError | A list of toornament service errors |
ToornamentErrors | A list of toornament service errors |
ToornamentServiceError | Toornament service error |
Tournament | A tournament object. |
TournamentId | A tournament identity. |
TournamentParticipantsFilter | A filter for tournament participants |
TournamentVideosFilter | A filter for tournament videos |
Tournaments | A list of |
Video | A tournament video |
Videos | A list of tournament videos |
Enums
CreateDateSortFilter | Create date sorting filter |
CustomFieldType | A type of a participant's custom field |
DateSortFilter | Date sorting filter |
Error | Toornament API error type. |
IterError | Iter errors |
MatchFormat | A Match format enumeration. |
MatchResultSimple | |
MatchStatus | A match status. |
MatchType | A match type enumeration. |
ParticipantType | A participant type enumeration. |
PermissionAttribute | Permission attribute definition |
StageType | Tournament stage type |
ToornamentErrorScope | A toornament service error scope |
ToornamentErrorType | A toornament service error type |
TournamentStatus | A tournament status. |
VideoCategory | Tournament video category |
Type Definitions
Date | A common type for toornament dates. |
Result | Toornament API |