pub struct ContextProvider { /* private fields */ }
Expand description
Provider for component context
Implementations§
Source§impl ContextProvider
impl ContextProvider
Sourcepub fn with_parent(parent: ContextProvider) -> Self
pub fn with_parent(parent: ContextProvider) -> Self
Create a context provider with a parent
Sourcepub fn provide<T: Clone + Send + Sync + Debug + 'static>(
&self,
value: T,
) -> Result<(), String>
pub fn provide<T: Clone + Send + Sync + Debug + 'static>( &self, value: T, ) -> Result<(), String>
Set a value in the context
Trait Implementations§
Source§impl Clone for ContextProvider
impl Clone for ContextProvider
Source§fn clone(&self) -> ContextProvider
fn clone(&self) -> ContextProvider
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ContextProvider
impl Debug for ContextProvider
Source§impl Default for ContextProvider
impl Default for ContextProvider
Source§fn default() -> ContextProvider
fn default() -> ContextProvider
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ContextProvider
impl RefUnwindSafe for ContextProvider
impl Send for ContextProvider
impl Sync for ContextProvider
impl Unpin for ContextProvider
impl UnwindSafe for ContextProvider
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Event for T
impl<T> Event for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to Any for downcasting (mutable)
Source§fn event_type(&self) -> &'static str
fn event_type(&self) -> &'static str
Get the event type name
Source§impl<T> Props for T
impl<T> Props for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to mutable Any for downcasting