pub struct RaceContext {
    pub sender: Arc<Mutex<WsSink>>,
    /* private fields */
}
Expand description

A type passed to RaceHandler callback methods which can be used to check the current status of the race or send messages.

Fields

sender: Arc<Mutex<WsSink>>

Implementations

Returns the current state of the race.

Sends a raw JSON message to the server.

The methods set_raceinfo through remove_monitor should be preferred.

Send a chat message to the race room.

message should be the message string you want to send.

Set the info field on the race room’s data.

info should be the information you wish to set, and pos the behavior in case there is existing info.

Set the room in an open state.

Set the room in an invite-only state.

Forces a start of the race.

Forcibly cancels a race.

Invites a user to the race.

user should be the hashid of the user.

Accepts a request to join the race room.

user should be the hashid of the user.

Forcibly unreadies an entrant.

user should be the hashid of the user.

Forcibly removes an entrant from the race.

user should be the hashid of the user.

Adds a user as a race monitor.

user should be the hashid of the user.

Removes a user as a race monitor.

user should be the hashid of the user.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

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

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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