pub struct Frontier { /* private fields */ }Expand description
The growing edge of a log: for each level, the hashes of its partial tile. Pushing a leaf fills level 0; a level that reaches 256 hashes becomes a full tile and contributes one hash to the level above.
Implementations§
Source§impl Frontier
impl Frontier
Sourcepub fn load(store: &impl TileStore, size: u64) -> Result<Self>
pub fn load(store: &impl TileStore, size: u64) -> Result<Self>
The frontier of a tree of size leaves, read from the partial tiles
the store holds for that size. Refused when a partial tile is missing
or has another width.
Sourcepub fn push(&mut self, leaf: Hash, completed: &mut Vec<(Tile, Vec<Hash>)>)
pub fn push(&mut self, leaf: Hash, completed: &mut Vec<(Tile, Vec<Hash>)>)
Appends one leaf hash. Every full tile the append completes is pushed
to completed, level 0 first, with its hashes.
Sourcepub fn partial_tiles(&self) -> Vec<(Tile, &[Hash])>
pub fn partial_tiles(&self) -> Vec<(Tile, &[Hash])>
The partial tiles at this size, with their hashes, level 0 first.
Trait Implementations§
impl Eq for Frontier
impl StructuralPartialEq for Frontier
Auto Trait Implementations§
impl Freeze for Frontier
impl RefUnwindSafe for Frontier
impl Send for Frontier
impl Sync for Frontier
impl Unpin for Frontier
impl UnsafeUnpin for Frontier
impl UnwindSafe for Frontier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more