pub struct Router<S: BotState> {
pub api: Arc<API>,
/* private fields */
}Fields§
§api: Arc<API>Implementations§
Source§impl<S: BotState> Router<S>
impl<S: BotState> Router<S>
pub fn with_poll_timeout_s(self, timeout_s: i64) -> Self
pub fn with_state(self, state: S) -> Self
pub fn with_error_handler<Func, Fut>(self, func: Func) -> Self
Sourcepub fn add_route(
&mut self,
r: Route,
h: impl Into<Box<dyn BotHandler<S>>>,
) -> &mut Self
pub fn add_route( &mut self, r: Route, h: impl Into<Box<dyn BotHandler<S>>>, ) -> &mut Self
Add a handler for messages matching a route in a chat. The handler is called with current state of the chat ID or the user ID, depending on the update.
pub fn shutdown(&self) -> (Arc<Notify>, Arc<Sender<()>>)
Auto Trait Implementations§
impl<S> Freeze for Router<S>
impl<S> !RefUnwindSafe for Router<S>
impl<S> Send for Router<S>
impl<S> Sync for Router<S>
impl<S> Unpin for Router<S>
impl<S> !UnwindSafe for Router<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