pub struct Layout {
pub size: u64,
}Expand description
The tiles a tree of one size is stored as.
Fields§
§size: u64Leaves in the tree.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn hashes_at(&self, level: u8) -> u64
pub fn hashes_at(&self, level: u8) -> u64
Hashes the tree has at level: floor(size / 256^level).
Sourcepub fn full_tiles_at(&self, level: u8) -> u64
pub fn full_tiles_at(&self, level: u8) -> u64
Full tiles at level.
Sourcepub fn width_at(&self, level: u8) -> u16
pub fn width_at(&self, level: u8) -> u16
Width of the partial tile at level, floor(size / 256^level) mod 256;
0 when the level ends on a full tile.
Sourcepub fn partial_at(&self, level: u8) -> Option<Tile>
pub fn partial_at(&self, level: u8) -> Option<Tile>
The partial tile at level, when there is one.
Sourcepub fn partial_tiles(&self) -> Vec<Tile>
pub fn partial_tiles(&self) -> Vec<Tile>
Every partial tile of the tree, level 0 first. Their hashes are exactly the perfect-subtree roots the tree root is folded from.
Sourcepub fn tile(&self, level: u8, index: u64) -> Option<Tile>
pub fn tile(&self, level: u8, index: u64) -> Option<Tile>
The tile at level and index as this tree stores it: full below the
partial, the partial at its width, nothing beyond.
Sourcepub fn full_bundles(&self) -> u64
pub fn full_bundles(&self) -> u64
Sealed (full) entry bundles.
Sourcepub fn partial_bundle_width(&self) -> u16
pub fn partial_bundle_width(&self) -> u16
Entries in the unsealed bundle, 0 to 255.
Trait Implementations§
impl Copy for Layout
impl Eq for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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