Trait UseContext

Source
pub trait UseContext<'a>: Sealed {
    // Required methods
    fn use_context<T: Any>(&self) -> Ref<'a, T>;
    fn use_context_mut<T: Any>(&self) -> RefMut<'a, T>;
    fn try_use_context<T: Any>(&self) -> Option<Ref<'a, T>>;
    fn try_use_context_mut<T: Any>(&self) -> Option<RefMut<'a, T>>;
}

Required Methods§

Source

fn use_context<T: Any>(&self) -> Ref<'a, T>

Source

fn use_context_mut<T: Any>(&self) -> RefMut<'a, T>

Source

fn try_use_context<T: Any>(&self) -> Option<Ref<'a, T>>

Source

fn try_use_context_mut<T: Any>(&self) -> Option<RefMut<'a, T>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> UseContext<'a> for Hooks<'a, '_>