Skip to main content

AlgView

Struct AlgView 

Source
pub struct AlgView {
    pub hasher: Box<dyn Hasher>,
    pub epochs: Vec<(u64, u64)>,
    pub frontier: Vec<Vec<u8>>,
    pub frontier_coords: Vec<(u64, u32)>,
}
Expand description

One algorithm’s single-tree continuation state: its hasher, committed epoch intervals, and frontier stack. This is the per-algorithm frontier only (D14) — the shared leaf data lives once in the combinator’s store, never here.

Fields§

§hasher: Box<dyn Hasher>

Hasher instance.

§epochs: Vec<(u64, u64)>

Epoch intervals: half-open [start, end). end == u64::MAX represents an active (open) epoch.

§frontier: Vec<Vec<u8>>

Frontier stack: holds hashes of completed subtrees.

§frontier_coords: Vec<(u64, u32)>

Coordinates of each frontier node: (left_index, height).

Implementations§

Source§

impl AlgView

Source

pub fn is_active(&self) -> bool

Whether this algorithm is currently active (not frozen).

Source

pub fn is_active_at(&self, i: u64) -> bool

Whether leaf/subtree index i falls within any of this algorithm’s active epochs.

Source

pub fn tree_size(&self, global_size: u64) -> u64

The tree size for this algorithm.

Active algorithms track the global tree size. Frozen algorithms stopped at their last deactivation point.

Source

pub fn first_activation(&self) -> u64

The activation index of the first epoch.

Source

pub fn active_range(&self, lo: u64, hi: u64) -> bool

Whether algorithm has active content in the half-open range [lo, hi).

Definition 14b (Active range): true iff any epoch overlaps the interval.

Source

pub fn fully_active(&self, lo: u64, hi: u64) -> bool

Whether the range [lo, hi) is fully contained within the active epochs.

Source

pub fn effective_size_at(&self, size: u64) -> u64

The algorithm-local tree size corresponding to global size size.

Active algorithms (or null-projection spans before first activation) see the full global size. Frozen algorithms cap at their last deactivation point; the maximum epoch end that is strictly less than size is the algorithm’s effective size.

Source

pub fn epochs_at(&self, size: u64) -> Option<Vec<(u64, u64)>>

The epoch timeline as it stood at size size, for commitment into the combined root and audit checkpoints (Design A+).

Intervals beginning after size are dropped; an interval extending past size is encoded as open (end == u64::MAX), matching what the timeline looked like when the log was that size. An interval closed exactly at size stays closed — this is what distinguishes “deactivated at the tip” from “still live, log idle” (frontier freshness). Returns None if the algorithm was not yet registered.

Trait Implementations§

Source§

impl Clone for AlgView

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AlgView

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.