pub struct WebhookServer { /* private fields */ }
Expand description
Represents a simple webhook server for handling incoming updates from the Telegram Bot API.
Implementations§
Source§impl WebhookServer
impl WebhookServer
Sourcepub fn new<A, B>(path: A, handler: B) -> WebhookServer
pub fn new<A, B>(path: A, handler: B) -> WebhookServer
Creates a new WebhookServer
.
§Arguments
path
- The path where the webhook server will receive incoming updates.handler
- The handler for processing updates.
Sourcepub async fn run<T>(self, address: T) -> Result<SocketAddr, Error>where
T: Into<SocketAddr>,
pub async fn run<T>(self, address: T) -> Result<SocketAddr, Error>where
T: Into<SocketAddr>,
Runs the server
Returns the local address that the server is bound to.
§Arguments
address
- The address to bind the server to.
Auto Trait Implementations§
impl Freeze for WebhookServer
impl !RefUnwindSafe for WebhookServer
impl Send for WebhookServer
impl Sync for WebhookServer
impl Unpin for WebhookServer
impl !UnwindSafe for WebhookServer
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