Enum tbot::errors::HttpWebhook
source · pub enum HttpWebhook {
SetWebhook(MethodCall),
SetWebhookTimeout(Elapsed),
SetMyCommands(MethodCall),
SetMyCommandsTimeout(Elapsed),
Server(Error),
}
Expand description
Represents possible errors that a webhook server may return.
Variants§
SetWebhook(MethodCall)
An error while setting the webhook.
SetWebhookTimeout(Elapsed)
Calling the setWebhook
method timed out.
SetMyCommands(MethodCall)
Calling the setMyCommands
method resulted in an error.
SetMyCommandsTimeout(Elapsed)
Calling the setMyCommands
method timed out.
Server(Error)
An error while running the server.
Implementations§
source§impl HttpWebhook
impl HttpWebhook
sourcepub fn is_set_webhook(&self) -> bool
pub fn is_set_webhook(&self) -> bool
Returns true
if self
is of variant SetWebhook
.
sourcepub fn expect_set_webhook(self) -> MethodCallwhere
Self: Debug,
pub fn expect_set_webhook(self) -> MethodCallwhere
Self: Debug,
Unwraps the value, yielding the content of SetWebhook
.
Panics
Panics if the value is not SetWebhook
, with a panic message including the content of self
.
sourcepub fn set_webhook(self) -> Option<MethodCall>
pub fn set_webhook(self) -> Option<MethodCall>
Returns Some
if self
is of variant SetWebhook
, and None
otherwise.
sourcepub fn is_set_webhook_timeout(&self) -> bool
pub fn is_set_webhook_timeout(&self) -> bool
Returns true
if self
is of variant SetWebhookTimeout
.
sourcepub fn expect_set_webhook_timeout(self) -> Elapsedwhere
Self: Debug,
pub fn expect_set_webhook_timeout(self) -> Elapsedwhere
Self: Debug,
Unwraps the value, yielding the content of SetWebhookTimeout
.
Panics
Panics if the value is not SetWebhookTimeout
, with a panic message including the content of self
.
sourcepub fn set_webhook_timeout(self) -> Option<Elapsed>
pub fn set_webhook_timeout(self) -> Option<Elapsed>
Returns Some
if self
is of variant SetWebhookTimeout
, 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.