[][src]Struct grin_chain::txhashset::PMMRHandle

pub struct PMMRHandle<T: PMMRable> {
    pub backend: PMMRBackend<T>,
    pub last_pos: u64,
}

Convenience wrapper around a single prunable MMR backend.

Fields

backend: PMMRBackend<T>

The backend storage for the MMR.

last_pos: u64

The last position accessible via this MMR handle (backend may continue out beyond this).

Methods

impl<T: PMMRable> PMMRHandle<T>[src]

pub fn new(
    root_dir: &str,
    sub_dir: &str,
    file_name: &str,
    prunable: bool,
    fixed_size: bool,
    version: ProtocolVersion,
    header: Option<&BlockHeader>
) -> Result<PMMRHandle<T>, Error>
[src]

Constructor to create a PMMR handle from an existing directory structure on disk. Creates the backend files as necessary if they do not already exist.

impl PMMRHandle<BlockHeader>[src]

pub fn get_header_hash_by_height(&self, height: u64) -> Result<Hash, Error>[src]

Get the header hash at the specified height based on the current header MMR state.

pub fn head_hash(&self) -> Result<Hash, Error>[src]

Get the header hash for the head of the header chain based on current MMR state. Find the last leaf pos based on MMR size and return its header hash.

Auto Trait Implementations

impl<T> RefUnwindSafe for PMMRHandle<T> where
    <T as PMMRable>::E: RefUnwindSafe

impl<T> Send for PMMRHandle<T> where
    <T as PMMRable>::E: Send

impl<T> Sync for PMMRHandle<T> where
    <T as PMMRable>::E: Sync

impl<T> Unpin for PMMRHandle<T> where
    <T as PMMRable>::E: Unpin

impl<T> UnwindSafe for PMMRHandle<T> where
    <T as PMMRable>::E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,