Struct tbot::event_loop::webhook::Webhook[][src]

#[must_use = "webhook does not start unless `start` is called"]
pub struct Webhook<'a> { /* fields omitted */ }

Configures webhook and starts a server.

To construct a Webhook, use EventLoop::webhook.

Implementations

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

pub const fn bind_to(self, bind_to: IpAddr) -> Self[src]

Configures the IP tbot will bind to.

pub fn accept_updates_on(self, url: String) -> Self[src]

Configures the URL that tbot will accept connections to. / by default.

Panics

Panics if the URL doesn’t starts with /.

pub fn ip_address(self, ip_address: impl Into<IpAddr>) -> Self[src]

Configures the IP address which the Bot API server will use to send updates avoiding DNS. Reflects the ip_address parameter.

pub const fn certificate(self, certificate: &'a str) -> Self[src]

Configures certificate.

pub const fn max_connections(self, max: NonZeroU32) -> Self[src]

Configures max_connections.

pub const fn allowed_updates(self, updates: AllowedUpdates) -> Self[src]

Configures allowed_updates.

pub const fn drop_pending_updates(self) -> Self[src]

Sets drop_pending_updates to true.

pub const fn request_timeout(self, timeout: Duration) -> Self[src]

Configures for how long tbot should wait for setWebhook. If you don’t configure this value, it is set to 60s.

pub const fn http(self) -> Http<'a>[src]

Configures a webhook server over HTTP. For HTTPS, see the https method.

pub const fn https(self, identity: Identity) -> Https<'a>[src]

Configures a webhook server over HTTPS. For HTTP, see the http method.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Webhook<'a>

impl<'a> Send for Webhook<'a>

impl<'a> Sync for Webhook<'a>

impl<'a> Unpin for Webhook<'a>

impl<'a> !UnwindSafe for Webhook<'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> From<T> for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.