pub struct Dispatcher<R, Err, Key> { /* private fields */ }
Expand description

The base for update dispatching.

Updates from different chats are handled concurrently, whereas updates from the same chats are handled sequentially. If the dispatcher is unable to determine a chat ID of an incoming update, it will be handled concurrently. Note that this behaviour can be altered with distribution_function.

See also: “Dispatching or REPLs?”

Implementations§

Constructs a new DispatcherBuilder with bot and handler.

Starts your bot with the default parameters.

The default parameters are a long polling update listener and log all errors produced by this listener.

Each time a handler is invoked, Dispatcher adds the following dependencies (in addition to those passed to DispatcherBuilder::dependencies):

Starts your bot with custom update_listener and update_listener_error_handler.

This method adds the same dependencies as Dispatcher::dispatch.

👎Deprecated since 0.10.0: use enable_ctrlc_handler on builder instead
Available on crate feature ctrlc_handler only.

Setups the ^C handler that shutdowns dispatching.

Returns a shutdown token, which can later be used to shutdown dispatching.

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
Unerase this erased pointer. Read more
Available on non-enforce_1_1_0_semantics only.
Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Turn this erasable pointer into an erased pointer. 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.

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