Struct tgbot::types::WebhookInfo

source ·
pub struct WebhookInfo {
    pub has_custom_certificate: bool,
    pub pending_update_count: Integer,
    pub url: String,
    pub allowed_updates: Option<Vec<AllowedUpdate>>,
    pub ip_address: Option<String>,
    pub last_error_date: Option<Integer>,
    pub last_error_message: Option<String>,
    pub last_synchronization_error_date: Option<Integer>,
    pub max_connections: Option<Integer>,
}
Expand description

Represents a current status of a webhook.

Fields§

§has_custom_certificate: bool

Indicates whether a custom certificate was provided for webhook certificate checks.

§pending_update_count: Integer

Number of updates awaiting delivery.

§url: String

Webhook URL, may be empty if webhook is not set up.

§allowed_updates: Option<Vec<AllowedUpdate>>

A list of update types the bot is subscribed to.

Defaults to all update types.

§ip_address: Option<String>

Currently used webhook IP address.

§last_error_date: Option<Integer>

Unix time for the most recent error that happened when trying to deliver an update via webhook.

§last_error_message: Option<String>

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<Integer>

Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters.

§max_connections: Option<Integer>

Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery.

Implementations§

source§

impl WebhookInfo

source

pub fn new<T>( url: T, has_custom_certificate: bool, pending_update_count: Integer ) -> Self
where T: Into<String>,

Creates a new WebhookInfo.

§Arguments
  • url - Webhook URL.
  • has_custom_certificate - Indicates whether a custom certificate was provided.
  • pending_update_count - Number of updates awaiting delivery.
source

pub fn with_allowed_updates<T>(self, value: T) -> Self
where T: IntoIterator<Item = AllowedUpdate>,

Sets a new list of allowed updates.

§Arguments
  • value - List of allowed updates.
source

pub fn with_ip_address<T>(self, value: T) -> Self
where T: Into<String>,

Sets a new IP address.

§Arguments
  • value - IP address.
source

pub fn with_last_error_date(self, value: Integer) -> Self

Sets a new last error date.

§Arguments
  • value - Last error date.
source

pub fn with_last_error_message<T>(self, value: T) -> Self
where T: Into<String>,

Sets a new last error message.

§Arguments
  • value - Last error message.
source

pub fn with_last_synchronization_error_date(self, value: Integer) -> Self

Sets a new last synchronization error date.

§Arguments
  • value - Last synchronization error date.
source

pub fn with_max_connections(self, value: Integer) -> Self

Sets a new number of max connections.

§Arguments
  • value - Number of max connections.

Trait Implementations§

source§

impl Clone for WebhookInfo

source§

fn clone(&self) -> WebhookInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WebhookInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for WebhookInfo

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for WebhookInfo

source§

fn eq(&self, other: &WebhookInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for WebhookInfo

source§

fn partial_cmp(&self, other: &WebhookInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for WebhookInfo

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for WebhookInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,