Struct sc_client_api::leaves::LeafSet [−][src]
pub struct LeafSet<H, N> { /* fields omitted */ }Expand description
list of leaf hashes ordered by number (descending). stored in memory for fast access. this allows very fast checking and modification of active leaves.
Implementations
Read the leaf list from the DB, using given prefix for keys.
update the leaf list on import. returns a displaced leaf if there was one.
Note a block height finalized, displacing all leaves with number less than the finalized block’s.
Although it would be more technically correct to also prune out leaves at the same number as the finalized block, but with different hashes, the current behavior is simpler and our assumptions about how finalization works means that those leaves will be pruned soon afterwards anyway.
Undo all pending operations.
This returns an Undo struct, where any
Displaced objects that have returned by previous method calls
should be passed to via the appropriate methods. Otherwise,
the on-disk state may get out of sync with in-memory state.
Revert to the given block height by dropping all leaves in the leaf set with a block number higher than the target.
returns an iterator over all hashes in the leaf set ordered by their block number descending.
Write the leaf list to the database transaction.
Trait Implementations
Auto Trait Implementations
impl<H, N> RefUnwindSafe for LeafSet<H, N> where
H: RefUnwindSafe,
N: RefUnwindSafe, impl<H, N> UnwindSafe for LeafSet<H, N> where
H: RefUnwindSafe + UnwindSafe,
N: RefUnwindSafe + UnwindSafe, Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any, Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more
Compare self to key and return true if they are equal.
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = TShould always be Self
The counterpart to unchecked_from.
Consume self to return an equivalent value of T.
pub fn vzip(self) -> VAttaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
impl<T> MaybeDebug for T where
T: Debug, impl<T> MaybeDebug for T where
T: Debug,