[−][src]Struct yewtil::Pure
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.
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<Self>
[src]
fn mounted(&mut self) -> bool
[src]
fn destroy(&mut self)
[src]
Auto Trait Implementations
impl<T> Send for Pure<T> where
T: Send,
T: Send,
impl<T> Sync for Pure<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Pure<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Pure<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Pure<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<COMP> Renderable<COMP> for COMP where
COMP: Component,
[src]
COMP: Component,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> Any for T where
T: Any,
T: Any,