[−][src]Struct tbot::event_loop::Polling
Configures and starts polling.
To construct Polling
, use Bot::polling
.
Implementations
impl Polling
[src]
pub fn limit(self, limit: u8) -> Self
[src]
Configures the limit of updates per request.
pub fn timeout(self, timeout: u64) -> Self
[src]
Configures the timeout for long polling.
pub fn allowed_updates(self, allowed_updates: &'static [UpdateKind]) -> Self
[src]
Configures which updates you'd like to listen to.
pub fn error_handler<H, F>(self, handler: H) -> Self where
H: Fn(Polling) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Polling) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a handler for errors ocurred while polling.
pub const fn poll_interval(self, poll_interval: Duration) -> Self
[src]
Configures the minimal interval between making requests. Set to 25ms
by default.
pub const fn request_timeout(self, timeout: Duration) -> Self
[src]
Configures for how long tbot
should wait for getUpdates
. If this
timeout is exceeded, an error handler is triggered. If you don't
configure this value, it is set to
Duration::from_secs(timeout.unwrap_or(0) + 60)
.
pub fn last_n_updates(self, n: NonZeroUsize) -> Self
[src]
Configures how many updates tbot
will process on start. If configured,
tbot
sets offset
's value to -n
when making the first request.
Panics
Panics if n
can't be converted to isize
safely.
impl Polling
[src]
pub async fn start(self) -> Result<Infallible, PollingSetup>
[src]
Starts the event loop.
Auto Trait Implementations
impl !RefUnwindSafe for Polling
impl Send for Polling
impl Sync for Polling
impl Unpin for Polling
impl !UnwindSafe for Polling
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,