[][src]Enum mogwai::view::Effect

pub enum Effect<T> {
    OnceNow {
        now: T,
    },
    ManyLater {
        later: Receiver<T>,
    },
    OnceNowAndManyLater {
        now: T,
        later: Receiver<T>,
    },
}

Effects describe a value right now or at many points in the future - or both.

Effects are used to change attributes, styles and inner text.

An Effect can be created from either a single value, a Receiver or a tuple of the two.

Variants

OnceNow

A value now.

Fields of OnceNow

now: T

The extant value.

ManyLater

Forthcoming values, to be delivered as messages from a Receiver.

Fields of ManyLater

later: Receiver<T>

The receiver that will deliver new values.

OnceNowAndManyLater

Both a value now and forthcoming values to be delivered as messages from a Receiver.

Fields of OnceNowAndManyLater

now: T

The extant value.

later: Receiver<T>

The receiver that will deliver new values.

Trait Implementations

impl<T: Clone> Clone for Effect<T>[src]

impl<'_> From<&'_ String> for Effect<String>[src]

impl<'_> From<&'_ str> for Effect<String>[src]

impl<'_> From<(&'_ str, Receiver<String>)> for Effect<String>[src]

impl<T> From<(Option<T>, Receiver<Rc<RefCell<Option<T>>>>)> for Effect<Rc<RefCell<Option<T>>>>[src]

impl<T> From<(T, Receiver<T>)> for Effect<T>[src]

impl From<Effect<String>> for ViewBuilder<Text>[src]

From instances for ViewBuilder.

Most of these mimic the corresponding From instances for View, the rest are here for the operation of this module.

impl From<Effect<String>> for View<Text>[src]

From instances for View

  • String, str etc get converted into View<Text> - ie text nodes, with their initial inner text set to the input string.
  • Receiver get converted into View<Text> with their inner text initially empty and then later set by the messages sent to the receiver.
  • Effect gets converted into View<Text> with possibly an initial string and updates through the receiver.
  • Any raw DOM element T gets wrapped by a view to make View<T>
  • Gizmo<C> returns its view, a View<<C::as Component>::DomNode>.

impl<T> From<Effect<T>> for (Option<T>, Option<Receiver<T>>)[src]

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

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

Auto Trait Implementations

impl<T> !RefUnwindSafe for Effect<T>

impl<T> !Send for Effect<T>

impl<T> !Sync for Effect<T>

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

impl<T> !UnwindSafe for Effect<T>

Blanket Implementations

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

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.