[−][src]Struct grin_chain::txhashset::PMMRHandle
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]
root_dir: &str,
sub_dir: &str,
file_name: &str,
prunable: bool,
fixed_size: bool,
version: ProtocolVersion,
header: Option<&BlockHeader>
) -> Result<PMMRHandle<T>, Error>
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,
<T as PMMRable>::E: RefUnwindSafe,
impl<T> Send for PMMRHandle<T> where
<T as PMMRable>::E: Send,
<T as PMMRable>::E: Send,
impl<T> Sync for PMMRHandle<T> where
<T as PMMRable>::E: Sync,
<T as PMMRable>::E: Sync,
impl<T> Unpin for PMMRHandle<T> where
<T as PMMRable>::E: Unpin,
<T as PMMRable>::E: Unpin,
impl<T> UnwindSafe for PMMRHandle<T> where
<T as PMMRable>::E: UnwindSafe,
<T as PMMRable>::E: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
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]
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> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,