tgbot/handler/mod.rs
1use std::future::Future;
2
3pub use self::longpoll::*;
4#[cfg(feature = "webhook")]
5pub use self::webhook::*;
6use crate::types::Update;
7
8mod longpoll;
9
10#[cfg(feature = "webhook")]
11mod webhook;
12
13/// Represents an update handler for processing updates received from the Telegram Bot API.
14pub trait UpdateHandler {
15 /// Handles a received update.
16 ///
17 /// # Arguments
18 ///
19 /// * `update` - The received update from the Telegram Bot API.
20 fn handle(&self, update: Update) -> impl Future<Output = ()> + Send;
21}