[−][src]Struct grin_store::leaf_set::LeafSet
Compact (roaring) bitmap representing the set of positions of leaves that are currently unpruned in the MMR.
Methods
impl LeafSet
[src]
pub fn open<P: AsRef<Path>>(path: P) -> Result<LeafSet>
[src]
Open the remove log file. The content of the file will be read in memory for fast checking.
pub fn copy_snapshot<P: AsRef<Path>>(path: P, cp_path: P) -> Result<()>
[src]
Copies a snapshot of the utxo file into the primary utxo file.
pub fn removed_pre_cutoff(
&self,
cutoff_pos: u64,
rewind_rm_pos: &Bitmap,
prune_list: &PruneList
) -> Bitmap
[src]
&self,
cutoff_pos: u64,
rewind_rm_pos: &Bitmap,
prune_list: &PruneList
) -> Bitmap
Calculate the set of pruned positions up to and including the cutoff_pos. Uses both the leaf_set and the prune_list to determine prunedness.
pub fn rewind(&mut self, cutoff_pos: u64, rewind_rm_pos: &Bitmap)
[src]
Rewinds the leaf_set back to a previous state. Removes all pos after the cutoff. Adds back all pos in rewind_rm_pos.
pub fn add(&mut self, pos: u64)
[src]
Append a new position to the leaf_set.
pub fn remove(&mut self, pos: u64)
[src]
Remove the provided position from the leaf_set.
pub fn snapshot(&self, header: &BlockHeader) -> Result<()>
[src]
Saves the utxo file tagged with block hash as filename suffix. Needed during fast-sync as the receiving node cannot rewind after receiving the txhashset zip file.
pub fn flush(&mut self) -> Result<()>
[src]
Flush the leaf_set to file.
pub fn discard(&mut self)
[src]
Discard any pending changes.
pub fn includes(&self, pos: u64) -> bool
[src]
Whether the leaf_set includes the provided position.
pub fn len(&self) -> usize
[src]
Number of positions stored in the leaf_set.
pub fn is_empty(&self) -> bool
[src]
Is the leaf_set empty.
pub fn iter(&self) -> impl Iterator<Item = u64> + '_
[src]
Iterator over positionns in the leaf_set (all leaf positions).
Auto Trait Implementations
impl Send for LeafSet
impl Sync for LeafSet
impl Unpin for LeafSet
impl UnwindSafe for LeafSet
impl RefUnwindSafe for LeafSet
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Erased for T
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,