pub struct StartRace {Show 20 fields
pub goal: String,
pub goal_is_custom: bool,
pub team_race: bool,
pub invitational: bool,
pub unlisted: bool,
pub ranked: bool,
pub info_user: String,
pub info_bot: String,
pub require_even_teams: bool,
pub start_delay: u8,
pub time_limit: u8,
pub time_limit_auto_complete: bool,
pub streaming_required: bool,
pub auto_start: bool,
pub allow_comments: bool,
pub hide_comments: bool,
pub allow_prerace_chat: bool,
pub allow_midrace_chat: bool,
pub allow_non_entrant_chat: bool,
pub chat_message_delay: u8,
}Fields§
§goal: StringIf the race has already started, this must match the current goal.
goal_is_custom: boolIf the race has already started, this must match the current goal.
team_race: bool§invitational: boolIf editing the race, this must match the current state. Use RaceContext::set_invitational or RaceContext::set_open instead.
unlisted: boolBots always have permission to set this field.
ranked: bool§info_user: String§info_bot: String§require_even_teams: bool§start_delay: u8Number of seconds the countdown should run for. Must be in 10..=60.
If the race has already started, this must match the current delay.
time_limit: u8Maximum number of hours the race is allowed to run for. Must be in 1..=72.
If the race has already started, this must match the current limit.
time_limit_auto_complete: bool§streaming_required: boolBots always have permission to set this field.
If the race has already started, this cannot be changed.
auto_start: boolIf the race has already started, this cannot be changed.
allow_comments: bool§hide_comments: bool§allow_prerace_chat: bool§allow_midrace_chat: bool§allow_non_entrant_chat: bool§chat_message_delay: u8Number of seconds to hold a message for before displaying it. Doesn’t affect race monitors or moderators. Must be in 0..=90.
Implementations§
Source§impl StartRace
impl StartRace
Sourcepub async fn start(
&self,
access_token: &str,
client: &Client,
category: &str,
) -> Result<String, Error>
pub async fn start( &self, access_token: &str, client: &Client, category: &str, ) -> Result<String, Error>
Creates a race room with the specified configuration and returns its slug.
An access token can be obtained using authorize.
pub async fn start_with_host( &self, host_info: &HostInfo, access_token: &str, client: &Client, category: &str, ) -> Result<String, Error>
Sourcepub async fn edit(
&self,
access_token: &str,
client: &Client,
category: &str,
race_slug: &str,
) -> Result<(), Error>
pub async fn edit( &self, access_token: &str, client: &Client, category: &str, race_slug: &str, ) -> Result<(), Error>
Edits the given race room.
Due to a limitation of the racetime.gg API, all fields including ones that should remain the same must be specified.
An access token can be obtained using authorize.
pub async fn edit_with_host( &self, host_info: &HostInfo, access_token: &str, client: &Client, category: &str, race_slug: &str, ) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for StartRace
impl RefUnwindSafe for StartRace
impl Send for StartRace
impl Sync for StartRace
impl Unpin for StartRace
impl UnwindSafe for StartRace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more