pub struct Context { /* private fields */ }Expand description
A context for rendering operations.
Implementations§
Source§impl Context
impl Context
Sourcepub fn insert<T: AnyValueSpec>(&mut self, key: ContextKey<T>, value: T::Item)
pub fn insert<T: AnyValueSpec>(&mut self, key: ContextKey<T>, value: T::Item)
Inserts a value into the context.
Sourcepub fn get<T: AnyValueSpec>(&self, key: ContextKey<T>) -> Option<&T::Item>
pub fn get<T: AnyValueSpec>(&self, key: ContextKey<T>) -> Option<&T::Item>
Gets a reference to a value from the context.
Sourcepub fn get_mut<T: AnyValueSpec>(
&mut self,
key: ContextKey<T>,
) -> Option<&mut T::Item>
pub fn get_mut<T: AnyValueSpec>( &mut self, key: ContextKey<T>, ) -> Option<&mut T::Item>
Gets a mutable reference to a value from the context.
Sourcepub fn remove<T: AnyValueSpec>(&mut self, key: ContextKey<T>) -> Option<T::Item>
pub fn remove<T: AnyValueSpec>(&mut self, key: ContextKey<T>) -> Option<T::Item>
Removes a value from the context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnsafeUnpin 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