Trait UseContext

Source
pub trait UseContext {
    type Message;

    // Required method
    fn use_context<T, F>(&self, f: F) -> ContextValue<T>
       where T: 'static + Clone + PartialEq,
             F: Fn(T) -> Self::Message + 'static;
}
Expand description

Functional component for using the context.

Required Associated Types§

Required Methods§

Source

fn use_context<T, F>(&self, f: F) -> ContextValue<T>
where T: 'static + Clone + PartialEq, F: Fn(T) -> Self::Message + 'static,

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.

Implementations on Foreign Types§

Source§

impl<C> UseContext for Scope<C>
where C: Component,

Source§

type Message = <C as Component>::Message

Source§

fn use_context<T, F>(&self, f: F) -> ContextValue<T>
where T: 'static + Clone + PartialEq, F: Fn(T) -> Self::Message + 'static,

Source§

impl<C> UseContext for Context<C>
where C: Component,

Source§

type Message = <C as Component>::Message

Source§

fn use_context<T, F>(&self, f: F) -> ContextValue<T>
where T: 'static + Clone + PartialEq, F: Fn(T) -> Self::Message + 'static,

Implementors§