pub enum Retention<C> {
Ephemeral,
Checkpoint {
id: C,
marking: Marking,
},
Marked,
Reference,
}Expand description
A type for metadata that is used to determine when and how a leaf can be pruned from a tree.
Variants§
Ephemeral
A leaf with Ephemeral retention will be pruned whenever its sibling is also a leaf with
Ephemeral retention.
Checkpoint
A leaf with Checkpoint retention will have its position retained in the tree
during pruning, but its value may be pruned (by merging with its sibling). If
Checkpoint retention is removed from the leaf, then the retention for the leaf will
become either Ephemeral, Marked, or Reference depending upon the value of the
marking field.
Marked
A leaf with Marked retention will be retained in the tree during pruning. Marked
retention may only be explicitly removed.
Reference
A leaf with Reference retention will be retained in the tree during pruning. Reference
retention is removed whenever the associated leaf is overwritten with a tree node having
Ephemeral, Checkpoint, or Marked retention.
Implementations§
Source§impl<C> Retention<C>
impl<C> Retention<C>
Sourcepub fn is_checkpoint(&self) -> bool
pub fn is_checkpoint(&self) -> bool
Returns whether the associated node has Retention::Checkpoint retention.
Sourcepub fn is_marked(&self) -> bool
pub fn is_marked(&self) -> bool
Returns whether the associated node has Retention::Marked retention
or Retention::Checkpoint retention with Marking::Marked marking.