Enum specs::Change [] [src]

pub enum Change {
    None,
    Inserted,
    Modified,
    Removed,
}

This enum represents the different changes the TrackedStorage can detect.

Resets

You most likely want to reset the TrackedStorage every frame. By doing that, all change events are cleared.

Maintain

By maintaining the FlaggedStorage, the inner storage and the cache will be searched for unequal elements, generating Modified events for those.

Frames

In the following, the term "frame" will be used to describe the timeframe between a reset and an eventual maintain. (eventual maintain because you may not be interested in Modified events)

Which event will be generated?

This section explains some edge cases.

There are no insertions, no removals, no maintained changes

No event (None)

There has been one insertion but also one removal in this frame

Because the change has been reverted, there's no event (None)

There has been a removal and an insertion in this frame

This is the only case where a Modified event will be generated without a call to maintain.

A component has been inserted and modified later in this frame (maintained)

The insertion has the bigger priority (Inserted).

A component has been modified and then removed

The removal has priority over the modification (Removed).

Variants

The component didn't change.

A component has been inserted.

The component has been modified.

The component has been removed.

Trait Implementations

impl Copy for Change
[src]

impl Clone for Change
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Change
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for Change
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl PartialOrd for Change
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more