Enum tbot::errors::PollingSetup
source · pub enum PollingSetup {
DeleteWebhook(MethodCall),
DeleteWebhookTimeout(Elapsed),
SetMyCommands(MethodCall),
SetMyCommandsTimeout(Elapsed),
}
Expand description
Represents possible errors that may happen during preparation of the polling event loop.
Variants§
DeleteWebhook(MethodCall)
Calling the deleteWebhook
method resulted in an error.
DeleteWebhookTimeout(Elapsed)
Calling the deleteWebhook
method timed out.
SetMyCommands(MethodCall)
Calling the setMyCommands
method resulted in an error.
SetMyCommandsTimeout(Elapsed)
Calling the setMyCommands
method timed out.
Implementations§
source§impl PollingSetup
impl PollingSetup
sourcepub fn is_delete_webhook(&self) -> bool
pub fn is_delete_webhook(&self) -> bool
Returns true
if self
is of variant DeleteWebhook
.
sourcepub fn expect_delete_webhook(self) -> MethodCallwhere
Self: Debug,
pub fn expect_delete_webhook(self) -> MethodCallwhere
Self: Debug,
Unwraps the value, yielding the content of DeleteWebhook
.
Panics
Panics if the value is not DeleteWebhook
, with a panic message including the content of self
.
sourcepub fn delete_webhook(self) -> Option<MethodCall>
pub fn delete_webhook(self) -> Option<MethodCall>
Returns Some
if self
is of variant DeleteWebhook
, and None
otherwise.
sourcepub fn is_delete_webhook_timeout(&self) -> bool
pub fn is_delete_webhook_timeout(&self) -> bool
Returns true
if self
is of variant DeleteWebhookTimeout
.
sourcepub fn expect_delete_webhook_timeout(self) -> Elapsedwhere
Self: Debug,
pub fn expect_delete_webhook_timeout(self) -> Elapsedwhere
Self: Debug,
Unwraps the value, yielding the content of DeleteWebhookTimeout
.
Panics
Panics if the value is not DeleteWebhookTimeout
, with a panic message including the content of self
.
sourcepub fn delete_webhook_timeout(self) -> Option<Elapsed>
pub fn delete_webhook_timeout(self) -> Option<Elapsed>
Returns Some
if self
is of variant DeleteWebhookTimeout
, and None
otherwise.
sourcepub fn is_set_my_commands(&self) -> bool
pub fn is_set_my_commands(&self) -> bool
Returns true
if self
is of variant SetMyCommands
.
sourcepub fn expect_set_my_commands(self) -> MethodCallwhere
Self: Debug,
pub fn expect_set_my_commands(self) -> MethodCallwhere
Self: Debug,
Unwraps the value, yielding the content of SetMyCommands
.
Panics
Panics if the value is not SetMyCommands
, with a panic message including the content of self
.
sourcepub fn set_my_commands(self) -> Option<MethodCall>
pub fn set_my_commands(self) -> Option<MethodCall>
Returns Some
if self
is of variant SetMyCommands
, and None
otherwise.
sourcepub fn is_set_my_commands_timeout(&self) -> bool
pub fn is_set_my_commands_timeout(&self) -> bool
Returns true
if self
is of variant SetMyCommandsTimeout
.
sourcepub fn expect_set_my_commands_timeout(self) -> Elapsedwhere
Self: Debug,
pub fn expect_set_my_commands_timeout(self) -> Elapsedwhere
Self: Debug,
Unwraps the value, yielding the content of SetMyCommandsTimeout
.
Panics
Panics if the value is not SetMyCommandsTimeout
, with a panic message including the content of self
.
sourcepub fn set_my_commands_timeout(self) -> Option<Elapsed>
pub fn set_my_commands_timeout(self) -> Option<Elapsed>
Returns Some
if self
is of variant SetMyCommandsTimeout
, and None
otherwise.