1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::future::Future;

pub use self::longpoll::*;
#[cfg(feature = "webhook")]
pub use self::webhook::*;
use crate::types::Update;

mod longpoll;

#[cfg(feature = "webhook")]
mod webhook;

/// Represents an update handler for processing updates received from the Telegram Bot API.
pub trait UpdateHandler {
    /// Handles a received update.
    ///
    /// # Arguments
    ///
    /// * `update` - The received update from the Telegram Bot API.
    fn handle(&self, update: Update) -> impl Future<Output = ()> + Send;
}