Struct telegram_types::bot::methods::SetWebhook[][src]

pub struct SetWebhook<'a> {
    pub url: Cow<'a, str>,
    pub ip_address: Option<IpAddr>,
    pub max_connections: Option<i32>,
    pub allowed_updates: Option<Cow<'a, [UpdateTypes]>>,
    pub drop_pending_updates: Option<bool>,
}

Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.

Fields

url: Cow<'a, str>

HTTPS url to send updates to. Use an empty string to remove webhook integration

ip_address: Option<IpAddr>

The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS

max_connections: Option<i32>

Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot’s server, and higher values to increase your bot’s throughput.

allowed_updates: Option<Cow<'a, [UpdateTypes]>>drop_pending_updates: Option<bool>

Pass True to drop all pending updates.

Implementations

impl<'a> SetWebhook<'a>[src]

pub fn new<T: Into<Cow<'a, str>>>(url: T) -> SetWebhook<'a>[src]

pub fn max_connections(self, x: i32) -> SetWebhook<'a>[src]

Trait Implementations

impl<'a> Clone for SetWebhook<'a>[src]

impl<'a> Debug for SetWebhook<'a>[src]

impl<'de, 'a> Deserialize<'de> for SetWebhook<'a>[src]

impl<'a> Eq for SetWebhook<'a>[src]

impl Method for SetWebhook<'_>[src]

type Item = bool

Method return type.

impl<'a> PartialEq<SetWebhook<'a>> for SetWebhook<'a>[src]

impl<'a> Serialize for SetWebhook<'a>[src]

impl<'a> StructuralEq for SetWebhook<'a>[src]

impl<'a> StructuralPartialEq for SetWebhook<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for SetWebhook<'a>

impl<'a> Send for SetWebhook<'a>

impl<'a> Sync for SetWebhook<'a>

impl<'a> Unpin for SetWebhook<'a>

impl<'a> UnwindSafe for SetWebhook<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.