pub struct Bot<S: Send + Sync + ?Sized + 'static> { /* private fields */ }Implementations§
Source§impl<S: Send + Sync + ?Sized + 'static> Bot<S>
impl<S: Send + Sync + ?Sized + 'static> Bot<S>
pub async fn new( category_slug: &str, client_id: &str, client_secret: &str, state: Arc<S>, ) -> Result<Self, Error>
pub async fn new_with_host( host_info: HostInfo, category_slug: &str, client_id: &str, client_secret: &str, state: Arc<S>, ) -> Result<Self, Error>
Sourcepub fn extra_room_sender(&self) -> Sender<String>
pub fn extra_room_sender(&self) -> Sender<String>
Returns a sender that takes extra room slugs (e.g. as returned from crate::StartRace::start) and has the bot handle those rooms.
This can be used to have the bot handle unlisted rooms, which aren’t detected automatically since they’re not listed on the category detail API endpoint. It can also be used to send listed rooms created by the bot to spawn the room handler immediately rather than waiting for the next check for new rooms.
Auto Trait Implementations§
impl<S> Freeze for Bot<S>where
S: ?Sized,
impl<S> !RefUnwindSafe for Bot<S>
impl<S> Send for Bot<S>where
S: ?Sized,
impl<S> Sync for Bot<S>where
S: ?Sized,
impl<S> Unpin for Bot<S>where
S: ?Sized,
impl<S> !UnwindSafe for Bot<S>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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