pub struct HandlerFlags(/* private fields */);Expand description
Typed, named metadata attached to a handler registration.
Flags are visible to filters, middleware, and the handler through
UpdateContext::handler_flags. They are the Rust equivalent of aiogram’s
handler flag dictionary without sacrificing static typing.
Implementations§
Source§impl HandlerFlags
impl HandlerFlags
pub fn new() -> Self
pub fn with<T: Any + Send + Sync>( self, name: impl Into<String>, value: T, ) -> Self
pub fn insert<T: Any + Send + Sync>( &mut self, name: impl Into<String>, value: T, )
pub fn get<T: Any + Send + Sync>(&self, name: &str) -> Option<Arc<T>>
pub fn get_cloned<T: Any + Clone + Send + Sync>(&self, name: &str) -> Option<T>
pub fn contains(&self, name: &str) -> bool
pub fn names(&self) -> impl Iterator<Item = &str>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Trait Implementations§
Source§impl Clone for HandlerFlags
impl Clone for HandlerFlags
Source§impl Debug for HandlerFlags
impl Debug for HandlerFlags
Auto Trait Implementations§
impl !RefUnwindSafe for HandlerFlags
impl !UnwindSafe for HandlerFlags
impl Freeze for HandlerFlags
impl Send for HandlerFlags
impl Sync for HandlerFlags
impl Unpin for HandlerFlags
impl UnsafeUnpin for HandlerFlags
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