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
None
The component didn't change.
Inserted
A component has been inserted.
Modified
The component has been modified.
Removed
The component has been removed.
Trait Implementations
impl Copy for Change
[src]
impl Clone for Change
[src]
fn clone(&self) -> Change
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Change
[src]
impl PartialEq for Change
[src]
fn eq(&self, __arg_0: &Change) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialOrd for Change
[src]
fn partial_cmp(&self, __arg_0: &Change) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more