Struct yew_state::component::wrapper::SharedStateComponent[][src]

pub struct SharedStateComponent<C, SCOPE = <<<C as Component>::Properties as SharedState>::Handle as Handle>::Handler> where
    C: Component,
    C::Properties: SharedState + Clone,
    <C::Properties as SharedState>::Handle: WrapperHandle,
    SCOPE: 'static, 
{ /* fields omitted */ }

Component wrapper for managing messages and state handles.

Wraps any component with properties that implement SharedState:

pub type MyComponent = SharedStateComponent<MyComponentModel>;

A scope may be provided to specify where the state is shared:

// This will only share state with other components using `FooScope`.
pub struct FooScope;
pub type MyComponent = SharedStateComponent<MyComponentModel, FooScope>;

Important

By default StorageHandle and GlobalHandle have different scopes. Though not enforced, components with different handles should not use the same scope.

Trait Implementations

impl<C, SCOPE> Component for SharedStateComponent<C, SCOPE> where
    C: Component,
    C::Properties: SharedState + Clone,
    <C::Properties as SharedState>::Handle: Clone + WrapperHandle
[src]

type Message = SharedStateComponentMsg<C::Properties>

Messages are used to make Components dynamic and interactive. Simple Component’s can declare their Message type to be (). Complex Component’s commonly use an enum to declare multiple Message types. Read more

type Properties = C::Properties

Properties are the inputs to a Component and should not mutated within a Component. They are passed to a Component using a JSX-style syntax. Read more

Auto Trait Implementations

impl<C, SCOPE = <<<C as Component>::Properties as SharedState>::Handle as Handle>::Handler> !RefUnwindSafe for SharedStateComponent<C, SCOPE>

impl<C, SCOPE = <<<C as Component>::Properties as SharedState>::Handle as Handle>::Handler> !Send for SharedStateComponent<C, SCOPE>

impl<C, SCOPE = <<<C as Component>::Properties as SharedState>::Handle as Handle>::Handler> !Sync for SharedStateComponent<C, SCOPE>

impl<C, SCOPE> Unpin for SharedStateComponent<C, SCOPE> where
    <C as Component>::Properties: Unpin

impl<C, SCOPE = <<<C as Component>::Properties as SharedState>::Handle as Handle>::Handler> !UnwindSafe for SharedStateComponent<C, SCOPE>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<COMP> Renderable for COMP where
    COMP: Component
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.