use std::{future::Future, sync::Arc};
pub use self::longpoll::*;
#[cfg(feature = "webhook")]
pub use self::webhook::*;
use crate::types::Update;
mod longpoll;
#[cfg(feature = "webhook")]
mod webhook;
pub trait UpdateHandler {
fn handle(&self, update: Update) -> impl Future<Output = ()> + Send;
}
impl<T> UpdateHandler for Arc<T>
where
T: UpdateHandler + Send + Sync,
{
async fn handle(&self, update: Update) {
self.as_ref().handle(update).await
}
}