telegram_bot2/
state.rs

1use std::ops::Deref;
2
3/// Contains the state of the bot. Currently only contains a user defined object, but will be augmented with other fields
4pub struct BotState<T>
5where
6    T: Sync,
7{
8    /// User defined state
9    pub state: T,
10}
11
12impl<T: Sync> Deref for BotState<T> {
13    type Target = T;
14
15    fn deref(&self) -> &Self::Target {
16        &self.state
17    }
18}