telexide_fork/client/event_handlers.rs
1use super::{Context, FutureOutcome};
2use crate::model::{raw::RawUpdate, Update};
3
4/// A function that handles a new update, it receives a [`Context`] and
5/// [`Update`] and returns a pinned future. Wrap an async function with
6/// `#[prepare_listener]` for easier development.
7pub type EventHandlerFunc = fn(Context, Update) -> FutureOutcome;
8
9/// A function that handles a new raw update, it receives a [`Context`] and
10/// [`RawUpdate`] and returns a pinned future. Wrap an async function with
11/// `#[prepare_listener]` for easier development.
12pub type RawEventHandlerFunc = fn(Context, RawUpdate) -> FutureOutcome;