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

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

Configures webhook and starts a server.

To construct a Webhook, use Bot::webhook.

Methods

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

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

Configures the IP tbot will bind to.

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

Configures certificate.

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

Configures max_connections.

pub fn allowed_updates(self, updates: &'a [Updates]) -> Self[src]

Configures allowed_updates.

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.

impl<'a, C> Webhook<'a, C> where
    C: Connect + Clone + Sync + 'static,
    C::Transport: 'static,
    C::Future: 'static, 
[src]

pub fn start(self) -> ![src]

Starts the server.

Trait Implementations

impl<'a, C> IntoFuture for Webhook<'a, C> where
    C: Connect + Clone + Sync + 'static,
    C::Transport: 'static,
    C::Future: 'static, 
[src]

type Future = Box<dyn Future<Item = Self::Item, Error = Self::Error> + Send>

The future that this type can be converted into.

type Item = ()

The item that the future may resolve with.

type Error = Webhook

The error that the future may resolve with.

Auto Trait Implementations

impl<'a, C> Sync for Webhook<'a, C> where
    C: Send + Sync

impl<'a, C> Send for Webhook<'a, C> where
    C: Send + Sync

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

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

impl<'a, C> !UnwindSafe for Webhook<'a, C>

Blanket Implementations

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

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

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.

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

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

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

impl<F> IntoFuture for F where
    F: Future
[src]

type Future = F

The future that this type can be converted into.

type Item = <F as Future>::Item

The item that the future may resolve with.

type Error = <F as Future>::Error

The error that the future may resolve with.

impl<T> Erased for T