logo
pub struct Effects<MSG, XMSG> {
    pub local: Vec<MSG, Global>,
    pub external: Vec<XMSG, Global>,
    /* private fields */
}
Expand description

Effects is a convenient way to group Msg for component to execute subsequent updates based on certain conditions. This can be used for doing animation and incremental changes to the view to provide an effect of transition or animation.

Effects contains 2 types of Messages. The local messages which will be executed in its own component on the next update loop. The other type is the external effects which are Messages that are sent to the parent Component in response to an event that has been triggerred.

Fields

local: Vec<MSG, Global>

Messages that will be executed locally in the Component

external: Vec<XMSG, Global>

effects that will be executed on the parent Component that instantiate this component

Implementations

create a new Effects with local and external expects respectively

split the local and external MSG of this effect

Create an Effects with local messages that will be executed on the next update loop on this Component

Create an Effects with extern messages that will be executed on the parent Component

Create and empty Effects

Map the local messages of this Effects such that MSG will be transposed into MSG2 with the use of the mapping function f.

The external messages stays the same.

derives an Effects which contains only local effects by transforming the external messages and mapping them with function f such that they can be of the same type as local effects them merge them together into local effects.

Append this msgs to the local effects

Modify the Effect such that it will not do an update on the view when it is executed

Modify the Effect such that it will log measurement when it is executed

Merge all the internal objects of this Vec of Effects to produce only one.

Extern the local and external MSG of this Effect

Trait Implementations

Convert Effects that has only follow ups

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.