pub struct Context {
pub api: Arc<Box<dyn API + Send>>,
pub data: Arc<RwLock<TypeMap>>,
}
Expand description
The context object is an utility object that gets passed to all event handlers, it provides access to the API client and to any custom data you have set in the data object.
Fields§
§api: Arc<Box<dyn API + Send>>
The API client, implementing the API
trait
data: Arc<RwLock<TypeMap>>
A clone of Client::data
, see its documentation for more detail
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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