Struct botapi::gen_types::WebhookInfo
source · pub struct WebhookInfo {
pub url: String,
pub has_custom_certificate: bool,
pub pending_update_count: i64,
pub ip_address: Option<String>,
pub last_error_date: Option<i64>,
pub last_error_message: Option<String>,
pub last_synchronization_error_date: Option<i64>,
pub max_connections: Option<i64>,
pub allowed_updates: Option<Vec<String>>,
}
Expand description
Describes the current status of a webhook.
Fields§
§url: String
Webhook URL, may be empty if webhook is not set up
has_custom_certificate: bool
True, if a custom certificate was provided for webhook certificate checks
pending_update_count: i64
Number of updates awaiting delivery
ip_address: Option<String>
Optional. Currently used webhook IP address
last_error_date: Option<i64>
Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
last_error_message: Option<String>
Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
last_synchronization_error_date: Option<i64>
Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters
max_connections: Option<i64>
Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
allowed_updates: Option<Vec<String>>
Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
Implementations§
source§impl WebhookInfo
impl WebhookInfo
pub fn noskip(self) -> NoSkipWebhookInfo
source§impl WebhookInfo
impl WebhookInfo
pub fn new( url: String, has_custom_certificate: bool, pending_update_count: i64, ) -> Self
sourcepub fn set_url<'a>(&'a mut self, url: String) -> &'a mut Self
pub fn set_url<'a>(&'a mut self, url: String) -> &'a mut Self
Webhook URL, may be empty if webhook is not set up
sourcepub fn get_has_custom_certificate<'a>(&'a self) -> bool
pub fn get_has_custom_certificate<'a>(&'a self) -> bool
True, if a custom certificate was provided for webhook certificate checks
sourcepub fn set_has_custom_certificate<'a>(
&'a mut self,
has_custom_certificate: bool,
) -> &'a mut Self
pub fn set_has_custom_certificate<'a>( &'a mut self, has_custom_certificate: bool, ) -> &'a mut Self
True, if a custom certificate was provided for webhook certificate checks
sourcepub fn get_pending_update_count<'a>(&'a self) -> i64
pub fn get_pending_update_count<'a>(&'a self) -> i64
Number of updates awaiting delivery
sourcepub fn set_pending_update_count<'a>(
&'a mut self,
pending_update_count: i64,
) -> &'a mut Self
pub fn set_pending_update_count<'a>( &'a mut self, pending_update_count: i64, ) -> &'a mut Self
Number of updates awaiting delivery
sourcepub fn get_ip_address<'a>(&'a self) -> Option<&'a str>
pub fn get_ip_address<'a>(&'a self) -> Option<&'a str>
Optional. Currently used webhook IP address
sourcepub fn set_ip_address<'a>(
&'a mut self,
ip_address: Option<String>,
) -> &'a mut Self
pub fn set_ip_address<'a>( &'a mut self, ip_address: Option<String>, ) -> &'a mut Self
Optional. Currently used webhook IP address
sourcepub fn get_last_error_date<'a>(&'a self) -> Option<i64>
pub fn get_last_error_date<'a>(&'a self) -> Option<i64>
Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
sourcepub fn set_last_error_date<'a>(
&'a mut self,
last_error_date: Option<i64>,
) -> &'a mut Self
pub fn set_last_error_date<'a>( &'a mut self, last_error_date: Option<i64>, ) -> &'a mut Self
Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
sourcepub fn get_last_error_message<'a>(&'a self) -> Option<&'a str>
pub fn get_last_error_message<'a>(&'a self) -> Option<&'a str>
Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
sourcepub fn set_last_error_message<'a>(
&'a mut self,
last_error_message: Option<String>,
) -> &'a mut Self
pub fn set_last_error_message<'a>( &'a mut self, last_error_message: Option<String>, ) -> &'a mut Self
Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
sourcepub fn get_last_synchronization_error_date<'a>(&'a self) -> Option<i64>
pub fn get_last_synchronization_error_date<'a>(&'a self) -> Option<i64>
Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters
sourcepub fn set_last_synchronization_error_date<'a>(
&'a mut self,
last_synchronization_error_date: Option<i64>,
) -> &'a mut Self
pub fn set_last_synchronization_error_date<'a>( &'a mut self, last_synchronization_error_date: Option<i64>, ) -> &'a mut Self
Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters
sourcepub fn get_max_connections<'a>(&'a self) -> Option<i64>
pub fn get_max_connections<'a>(&'a self) -> Option<i64>
Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
sourcepub fn set_max_connections<'a>(
&'a mut self,
max_connections: Option<i64>,
) -> &'a mut Self
pub fn set_max_connections<'a>( &'a mut self, max_connections: Option<i64>, ) -> &'a mut Self
Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
sourcepub fn get_allowed_updates<'a>(&'a self) -> Option<&'a Vec<String>>
pub fn get_allowed_updates<'a>(&'a self) -> Option<&'a Vec<String>>
Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
sourcepub fn set_allowed_updates<'a>(
&'a mut self,
allowed_updates: Option<Vec<String>>,
) -> &'a mut Self
pub fn set_allowed_updates<'a>( &'a mut self, allowed_updates: Option<Vec<String>>, ) -> &'a mut Self
Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
Trait Implementations§
source§impl Clone for WebhookInfo
impl Clone for WebhookInfo
source§fn clone(&self) -> WebhookInfo
fn clone(&self) -> WebhookInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WebhookInfo
impl Debug for WebhookInfo
source§impl Default for WebhookInfo
impl Default for WebhookInfo
source§fn default() -> WebhookInfo
fn default() -> WebhookInfo
source§impl<'de> Deserialize<'de> for WebhookInfo
impl<'de> Deserialize<'de> for WebhookInfo
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<BoxWrapper<Box<WebhookInfo>>> for WebhookInfo
impl From<BoxWrapper<Box<WebhookInfo>>> for WebhookInfo
source§fn from(t: BoxWrapper<Box<WebhookInfo>>) -> Self
fn from(t: BoxWrapper<Box<WebhookInfo>>) -> Self
source§impl From<BoxWrapper<Unbox<WebhookInfo>>> for WebhookInfo
impl From<BoxWrapper<Unbox<WebhookInfo>>> for WebhookInfo
source§fn from(t: BoxWrapper<Unbox<WebhookInfo>>) -> Self
fn from(t: BoxWrapper<Unbox<WebhookInfo>>) -> Self
source§impl From<NoSkipWebhookInfo> for WebhookInfo
impl From<NoSkipWebhookInfo> for WebhookInfo
source§fn from(t: NoSkipWebhookInfo) -> Self
fn from(t: NoSkipWebhookInfo) -> Self
source§impl Hash for WebhookInfo
impl Hash for WebhookInfo
source§impl Into<NoSkipWebhookInfo> for WebhookInfo
impl Into<NoSkipWebhookInfo> for WebhookInfo
source§fn into(self) -> NoSkipWebhookInfo
fn into(self) -> NoSkipWebhookInfo
source§impl Ord for WebhookInfo
impl Ord for WebhookInfo
source§fn cmp(&self, other: &WebhookInfo) -> Ordering
fn cmp(&self, other: &WebhookInfo) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for WebhookInfo
impl PartialEq for WebhookInfo
source§fn eq(&self, other: &WebhookInfo) -> bool
fn eq(&self, other: &WebhookInfo) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for WebhookInfo
impl PartialOrd for WebhookInfo
source§fn partial_cmp(&self, other: &WebhookInfo) -> Option<Ordering>
fn partial_cmp(&self, other: &WebhookInfo) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for WebhookInfo
impl Serialize for WebhookInfo
impl Eq for WebhookInfo
impl StructuralPartialEq for WebhookInfo
Auto Trait Implementations§
impl Freeze for WebhookInfo
impl RefUnwindSafe for WebhookInfo
impl Send for WebhookInfo
impl Sync for WebhookInfo
impl Unpin for WebhookInfo
impl UnwindSafe for WebhookInfo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.