pub struct StateKey {
pub user_id: Option<i64>,
pub chat_id: i64,
}Expand description
Identifies which conversation slot to read/write state for.
The canonical strategy is per-user-per-chat so that the same user can have independent sessions in different chats simultaneously.
Fields§
§user_id: Option<i64>The Telegram user ID, if applicable.
chat_id: i64The Telegram chat ID.
Implementations§
Source§impl StateKey
impl StateKey
Sourcepub fn from_message(msg: &impl MessageLike, strategy: StateKeyStrategy) -> Self
pub fn from_message(msg: &impl MessageLike, strategy: StateKeyStrategy) -> Self
Construct a key from an incoming message using the given strategy.
Trait Implementations§
impl Eq for StateKey
impl StructuralPartialEq for StateKey
Auto Trait Implementations§
impl Freeze for StateKey
impl RefUnwindSafe for StateKey
impl Send for StateKey
impl Sync for StateKey
impl Unpin for StateKey
impl UnsafeUnpin for StateKey
impl UnwindSafe for StateKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more