[][src]Struct splits_io_api::Race

pub struct Race {
    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,
}

A Race is a live competition between multiple Runners who share a start time for their run.

API Documentation

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

impl Race[src]

pub async fn get_active(client: &Client) -> Result<Vec<Race>, Error>[src]

Gets all the currently active Races on Splits.io.

pub async fn get(client: &Client, id: Uuid) -> Result<Race, Error>[src]

Gets a Race by its ID.

pub async fn create(
    client: &Client,
    settings: Settings<'_>
) -> Result<Race, Error>
[src]

Creates a new Race.

pub async fn update(
    &self,
    client: &Client,
    settings: UpdateSettings<'_>
) -> Result<Race, Error>
[src]

Updates the Race.

pub async fn entries(&self, client: &Client) -> Result<Vec<Entry>, Error>[src]

Gets all of the entries for the Race.

pub async fn my_entry(&self, client: &Client) -> Result<Entry, Error>[src]

Gets the entry in the Race that is associated with the current user.

pub async fn join(
    &self,
    client: &Client,
    join_as: JoinAs<'_>,
    join_token: Option<&str>
) -> Result<Entry, Error>
[src]

Joins the Race for the given entry.

pub async fn leave(&self, client: &Client, entry_id: Uuid) -> Result<(), Error>[src]

Leaves the Race for the given entry.

pub async fn ready_up(
    &self,
    client: &Client,
    entry_id: Uuid
) -> Result<Entry, Error>
[src]

Declares the given entry as ready for the Race.

pub async fn unready(
    &self,
    client: &Client,
    entry_id: Uuid
) -> Result<Entry, Error>
[src]

Undoes a ready for the given entry in th Race.

pub async fn finish(
    &self,
    client: &Client,
    entry_id: Uuid
) -> Result<Entry, Error>
[src]

Finishes the Race for the given entry.

pub async fn undo_finish(
    &self,
    client: &Client,
    entry_id: Uuid
) -> Result<Entry, Error>
[src]

Undoes a finish for the given entry in the Race.

pub async fn forfeit(
    &self,
    client: &Client,
    entry_id: Uuid
) -> Result<Entry, Error>
[src]

Forfeits the Race for the given entry.

pub async fn undo_forfeit(
    &self,
    client: &Client,
    entry_id: Uuid
) -> Result<Entry, Error>
[src]

Undoes a forfeit for the given entry in the Race.

pub async fn chat_messages(
    &self,
    client: &Client
) -> Result<Vec<ChatMessage>, Error>
[src]

Gets all of the chat messages for the Race.

pub async fn send_chat_message(
    &self,
    client: &Client,
    message: &str
) -> Result<ChatMessage, Error>
[src]

Sends a message in the chat for the Race.

Trait Implementations

impl Debug for Race[src]

impl<'de> Deserialize<'de> for Race[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.