Struct yew_state::component::wrapper::SharedStateComponent [−][src]
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]
C: Component,
C::Properties: SharedState + Clone,
<C::Properties as SharedState>::Handle: Clone + WrapperHandle,
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
fn create(props: Self::Properties, link: ComponentLink<Self>) -> Self
[src]
fn update(&mut self, msg: Self::Message) -> ShouldRender
[src]
fn change(&mut self, props: Self::Properties) -> ShouldRender
[src]
fn view(&self) -> Html
[src]
pub fn rendered(&mut self, _first_render: bool)
[src]
pub fn destroy(&mut self)
[src]
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,
<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]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<COMP> Renderable for COMP where
COMP: Component,
[src]
COMP: Component,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,