pub struct Webhook<'a> { /* private fields */ }Expand description
Configures webhook and starts a server.
To construct a Webhook, use Bot::webhook.
Implementations§
Source§impl<'a> Webhook<'a>
impl<'a> Webhook<'a>
Sourcepub fn accept_updates_on(self, url: String) -> Self
pub fn accept_updates_on(self, url: String) -> Self
Configures the URL that tbot will accept connections to.
/ by default.
§Panics
Panics if the URL doesn’t starts with /.
Sourcepub fn certificate(self, certificate: &'a str) -> Self
pub fn certificate(self, certificate: &'a str) -> Self
Configures certificate.
Sourcepub fn max_connections(self, max: u8) -> Self
pub fn max_connections(self, max: u8) -> Self
Configures max_connections.
Sourcepub fn allowed_updates(self, updates: &'a [UpdateKind]) -> Self
pub fn allowed_updates(self, updates: &'a [UpdateKind]) -> Self
Configures allowed_updates.
Sourcepub const fn request_timeout(self, timeout: Duration) -> Self
pub const fn request_timeout(self, timeout: Duration) -> Self
Configures for how long tbot should wait for setWebhook. If you
don’t configure this value, it is set to 60s.
Auto Trait Implementations§
impl<'a> Freeze for Webhook<'a>
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§
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
Mutably borrows from an owned value. Read more