[][src]Struct yewtil::Pure

pub struct Pure<T>(_);

Wrapper component for pure components.

Due to constraints in Rust's coherence rules, Component can't be implemented for any T that implements PureComponent, so instead this struct wraps a T: PureComponent and Component is implemented for this instead.

Example

It is reasonable practice to use Pure as a prefix or Impl as a suffix to your pure component model and use an alias to provide a terser name to be used by other components:

use yew::Properties;
use yew::Html;
use yewtil::{PureComponent, Pure, Emissive};

#[derive(Properties, PartialEq, Emissive)]
pub struct PureMyComponent {
    pub data: String
}

impl PureComponent for PureMyComponent {
fn render(&self) -> Html<Pure<Self>> {
       // ...
    }
}

/// Use this from within `html!` macros.
pub type MyComponent = Pure<PureMyComponent>;

Trait Implementations

impl<T: Debug> Debug for Pure<T>[src]

impl<T: PureEmissiveComponent + 'static> Component for Pure<T>[src]

type Message = <T as PureEmissiveComponent>::Message

Control message type which update loop get.

type Properties = T

Properties type of component implementation.

Auto Trait Implementations

impl<T> Send for Pure<T> where
    T: Send

impl<T> Sync for Pure<T> where
    T: Sync

impl<T> Unpin for Pure<T> where
    T: Unpin

impl<T> UnwindSafe for Pure<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for Pure<T> where
    T: RefUnwindSafe

Blanket Implementations

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

impl<T> From<T> for T[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.

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

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

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

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

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: Any