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.

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§

source§

impl Race

source

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

Gets all the currently active Races on splits.io.

source

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

Gets a Race by its ID.

source

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

Creates a new Race.

source

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

Updates the Race.

source

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

Gets all of the entries for the Race.

source

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

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

source

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

Joins the Race for the given entry.

source

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

Leaves the Race for the given entry.

source

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

Declares the given entry as ready for the Race.

source

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

Undoes a ready for the given entry in th Race.

source

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

Finishes the Race for the given entry.

source

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

Undoes a finish for the given entry in the Race.

source

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

Forfeits the Race for the given entry.

source

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

Undoes a forfeit for the given entry in the Race.

source

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

Gets all of the chat messages for the Race.

source

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

Sends a message in the chat for the Race.

Trait Implementations§

source§

impl Debug for Race

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Race

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Race

§

impl Send for Race

§

impl Sync for Race

§

impl Unpin for Race

§

impl UnwindSafe for Race

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

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