#[non_exhaustive]
pub struct PollingBuilder<R> { pub bot: R, pub timeout: Option<Duration>, pub limit: Option<u8>, pub allowed_updates: Option<Vec<AllowedUpdate>>, pub drop_pending_updates: bool, }
Expand description

Builder for polling update listener.

Can be created by Polling::builder.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§bot: R§timeout: Option<Duration>§limit: Option<u8>§allowed_updates: Option<Vec<AllowedUpdate>>§drop_pending_updates: bool

Implementations§

A timeout in seconds for polling.

Note

timeout should not be bigger than http client timeout, see default_reqwest_settings for default http client settings.

Limit the number of updates to be retrieved at once. Values between 1—100 are accepted.

Panics

If limit is 0 or greater than 100.

A list of the types of updates you want to receive.

Note

teloxide normally (when using Dispatcher or repls) sets this automatically via hint_allowed_updates, so you rarely need to use allowed_updates explicitly.

Drops pending updates.

Deletes webhook if it was set up.

Returns a long polling update listener with configuration from the builder.

See also: polling_default, Polling.

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