[][src]Struct grin_chain::txhashset::HeaderExtension

pub struct HeaderExtension<'a> {
    pub batch: &'a Batch<'a>,
    // some fields omitted
}

A header extension to allow the header MMR to extend beyond the other MMRs individually. This is to allow headers to be validated against the MMR before we have the full block data.

Fields

Batch in which the extension occurs, public so it can be used within an extending closure. Just be careful using it that way as it will get rolled back with the extension (i.e on a losing fork).

Methods

impl<'a> HeaderExtension<'a>
[src]

Apply a new header to the header MMR extension. This may be either the header MMR or the sync MMR depending on the extension.

Rewind the header extension to the specified header. Note the close relationship between header height and insertion index.

Truncate the header MMR (rewind all the way back to pos 0). Used when rebuilding the header MMR by reapplying all headers including the genesis block header.

The size of the header MMR.

TODO - think about how to optimize this. Requires all header hashes to be iterated over in ascending order.

The root of the header MMR for convenience.

Validate the prev_root of the header against the root of the current header MMR.

Auto Trait Implementations

impl<'a> !Send for HeaderExtension<'a>

impl<'a> !Sync for HeaderExtension<'a>

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

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

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Mutably borrows from an owned value. Read more

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

Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more

impl<T> UnsafeAny for T where
    T: Any

impl<T> Erased for T

impl<T> Same for T

Should always be Self