[][src]Enum tbot::errors::Polling

pub enum Polling {
    Fetching(MethodCall),
    Timeout(Elapsed),
}

Represents possible errors that may happen during the polling event loop.

Variants

Fetching(MethodCall)

Calling GetUpdates resulted in an error.

Timeout(Elapsed)

Calling GetUpdates timed out.

Implementations

impl Polling[src]

pub fn is_fetching(&self) -> bool[src]

Returns true if self is of variant Fetching.

pub fn expect_fetching(self) -> MethodCall where
    Self: Debug
[src]

Unwraps the value, yielding the content of Fetching.

Panics

Panics if the value is not Fetching, with a panic message including the content of self.

pub fn fetching(self) -> Option<MethodCall>[src]

Returns Some if self is of variant Fetching, and None otherwise.

pub fn is_timeout(&self) -> bool[src]

Returns true if self is of variant Timeout.

pub fn expect_timeout(self) -> Elapsed where
    Self: Debug
[src]

Unwraps the value, yielding the content of Timeout.

Panics

Panics if the value is not Timeout, with a panic message including the content of self.

pub fn timeout(self) -> Option<Elapsed>[src]

Returns Some if self is of variant Timeout, and None otherwise.

Trait Implementations

impl Debug for Polling[src]

impl From<Elapsed> for Polling[src]

impl From<MethodCall> for Polling[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithSubscriber for T[src]