Struct splits_io_api::Race
source · pub struct Race {Show 14 fields
pub attachments: Vec<Attachment>,
pub category: Option<Category>,
pub chat_messages: Vec<ChatMessage>,
pub created_at: Box<str>,
pub entries: Vec<Entry>,
pub game: Option<Game>,
pub id: Uuid,
pub join_token: Option<Box<str>>,
pub notes: Option<Box<str>>,
pub owner: Runner,
pub path: Box<str>,
pub started_at: Option<Box<str>>,
pub updated_at: Box<str>,
pub visibility: Visibility,
}
Expand description
A Race is a live competition between multiple Runners who share a start time for their run.
Fields§
§attachments: Vec<Attachment>
Any attachments supplied by the race creator for the benefit of other entrants (e.g. for randomizers).
category: Option<Category>
The category being raced.
chat_messages: Vec<ChatMessage>
Chat messages for the Race. Only present when fetching the Race individually.
created_at: Box<str>
The time and date at which this Race was created on splits.io. This field conforms to ISO 8601.
entries: Vec<Entry>
All Entries currently in the Race.
game: Option<Game>
The game being raced.
id: Uuid
The unique ID of the Race.
join_token: Option<Box<str>>
The token needed to join the race if it’s invite-only or secret. Only provided to the owner as a response to creation.
notes: Option<Box<str>>
Any notes associatied with the Race.
owner: Runner
The Runner who created the Race.
path: Box<str>
The user-friendly URL to the Race, to be given to a user when necessary.
started_at: Option<Box<str>>
The time and date at which this Race was started on splits.io. This field conforms to ISO 8601.
updated_at: Box<str>
The time and date at which this Race was most recently modified on splits.io. This field conforms to ISO 8601.
visibility: Visibility
The permission set for the Race.
Implementations§
source§impl Race
impl Race
sourcepub async fn get_active(client: &Client) -> Result<Vec<Race>, Error>
pub async fn get_active(client: &Client) -> Result<Vec<Race>, Error>
Gets all the currently active Races on splits.io.
sourcepub async fn create(
client: &Client,
settings: Settings<'_>
) -> Result<Race, Error>
pub async fn create( client: &Client, settings: Settings<'_> ) -> Result<Race, Error>
Creates a new Race.
sourcepub async fn update(
&self,
client: &Client,
settings: UpdateSettings<'_>
) -> Result<Race, Error>
pub async fn update( &self, client: &Client, settings: UpdateSettings<'_> ) -> Result<Race, Error>
Updates the Race.
sourcepub async fn entries(&self, client: &Client) -> Result<Vec<Entry>, Error>
pub async fn entries(&self, client: &Client) -> Result<Vec<Entry>, Error>
Gets all of the entries for the Race.
sourcepub async fn my_entry(&self, client: &Client) -> Result<Entry, Error>
pub async fn my_entry(&self, client: &Client) -> Result<Entry, Error>
Gets the entry in the Race that is associated with the current user.
sourcepub async fn join(
&self,
client: &Client,
join_as: JoinAs<'_>,
join_token: Option<&str>
) -> Result<Entry, Error>
pub async fn join( &self, client: &Client, join_as: JoinAs<'_>, join_token: Option<&str> ) -> Result<Entry, Error>
Joins the Race for the given entry.
sourcepub async fn leave(&self, client: &Client, entry_id: Uuid) -> Result<(), Error>
pub async fn leave(&self, client: &Client, entry_id: Uuid) -> Result<(), Error>
Leaves the Race for the given entry.
sourcepub async fn ready_up(
&self,
client: &Client,
entry_id: Uuid
) -> Result<Entry, Error>
pub async fn ready_up( &self, client: &Client, entry_id: Uuid ) -> Result<Entry, Error>
Declares the given entry as ready for the Race.
sourcepub async fn unready(
&self,
client: &Client,
entry_id: Uuid
) -> Result<Entry, Error>
pub async fn unready( &self, client: &Client, entry_id: Uuid ) -> Result<Entry, Error>
Undoes a ready for the given entry in th Race.
sourcepub async fn finish(
&self,
client: &Client,
entry_id: Uuid
) -> Result<Entry, Error>
pub async fn finish( &self, client: &Client, entry_id: Uuid ) -> Result<Entry, Error>
Finishes the Race for the given entry.
sourcepub async fn undo_finish(
&self,
client: &Client,
entry_id: Uuid
) -> Result<Entry, Error>
pub async fn undo_finish( &self, client: &Client, entry_id: Uuid ) -> Result<Entry, Error>
Undoes a finish for the given entry in the Race.
sourcepub async fn forfeit(
&self,
client: &Client,
entry_id: Uuid
) -> Result<Entry, Error>
pub async fn forfeit( &self, client: &Client, entry_id: Uuid ) -> Result<Entry, Error>
Forfeits the Race for the given entry.
sourcepub async fn undo_forfeit(
&self,
client: &Client,
entry_id: Uuid
) -> Result<Entry, Error>
pub async fn undo_forfeit( &self, client: &Client, entry_id: Uuid ) -> Result<Entry, Error>
Undoes a forfeit for the given entry in the Race.
sourcepub async fn chat_messages(
&self,
client: &Client
) -> Result<Vec<ChatMessage>, Error>
pub async fn chat_messages( &self, client: &Client ) -> Result<Vec<ChatMessage>, Error>
Gets all of the chat messages for the Race.
sourcepub async fn send_chat_message(
&self,
client: &Client,
message: &str
) -> Result<ChatMessage, Error>
pub async fn send_chat_message( &self, client: &Client, message: &str ) -> Result<ChatMessage, Error>
Sends a message in the chat for the Race.