Enum tbot::errors::HttpsWebhook
source · pub enum HttpsWebhook {
SetWebhook(MethodCall),
SetWebhookTimeout(Elapsed),
SetMyCommands(MethodCall),
SetMyCommandsTimeout(Elapsed),
Tls(Error),
Bind(Error),
Server(Error),
}
Expand description
Represents possible errors that an HTTPS 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.
Tls(Error)
An error while initializing TLS.
Bind(Error)
An error while binding to a port.
Server(Error)
An error while running the server.
Implementations§
source§impl HttpsWebhook
impl HttpsWebhook
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.
sourcepub fn expect_tls(self) -> Errorwhere
Self: Debug,
pub fn expect_tls(self) -> Errorwhere
Self: Debug,
sourcepub fn expect_bind(self) -> Errorwhere
Self: Debug,
pub fn expect_bind(self) -> Errorwhere
Self: Debug,
sourcepub fn bind(self) -> Option<Error>
pub fn bind(self) -> Option<Error>
Returns Some
if self
is of variant Bind
, and None
otherwise.