pub struct ShardedTreeSnapshot {
pub depth: usize,
pub shard_height: usize,
pub completed_roots: Vec<Fr>,
pub live_leaves: Vec<Fr>,
pub owned_notes: Vec<OwnedNoteWitness>,
}Expand description
Minimal state needed to restore a ShardedNotesTree.
Fields§
§depth: usize§shard_height: usize§completed_roots: Vec<Fr>§live_leaves: Vec<Fr>§owned_notes: Vec<OwnedNoteWitness>Implementations§
Source§impl ShardedTreeSnapshot
impl ShardedTreeSnapshot
Sourcepub fn encode(&self) -> Result<Vec<u8>, TreeError>
pub fn encode(&self) -> Result<Vec<u8>, TreeError>
Encode a deterministic, versioned binary snapshot.
Field elements use canonical 32-byte big-endian encoding. Chain identity, block hash and sync cursor intentionally remain storage-layer metadata, so this blob can be embedded in any caller’s checkpoint format.
pub fn decode(bytes: &[u8]) -> Result<Self, TreeError>
Trait Implementations§
Source§impl Clone for ShardedTreeSnapshot
impl Clone for ShardedTreeSnapshot
Source§fn clone(&self) -> ShardedTreeSnapshot
fn clone(&self) -> ShardedTreeSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShardedTreeSnapshot
impl Debug for ShardedTreeSnapshot
impl Eq for ShardedTreeSnapshot
Source§impl PartialEq for ShardedTreeSnapshot
impl PartialEq for ShardedTreeSnapshot
impl StructuralPartialEq for ShardedTreeSnapshot
Auto Trait Implementations§
impl Freeze for ShardedTreeSnapshot
impl RefUnwindSafe for ShardedTreeSnapshot
impl Send for ShardedTreeSnapshot
impl Sync for ShardedTreeSnapshot
impl Unpin for ShardedTreeSnapshot
impl UnsafeUnpin for ShardedTreeSnapshot
impl UnwindSafe for ShardedTreeSnapshot
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more