Struct noble_mmr_primitives::OpaqueLeaf[][src]

pub struct OpaqueLeaf(pub Vec<u8>);

A helper type to allow using arbitrary SCALE-encoded leaf data in the RuntimeApi.

The point is to be able to verify MMR proofs from external MMRs, where we don’t know the exact leaf type, but it’s enough for us to have it SCALE-encoded.

Note the leaf type should be encoded in its compact form when passed through this type. See FullLeaf documentation for details.

This type does not implement SCALE encoding/decoding on purpose to avoid confusion, it would have to be SCALE-compatible with the concrete leaf type, but due to SCALE limitations it’s not possible to know how many bytes the encoding of concrete leaf type uses.

Implementations

impl OpaqueLeaf[src]

pub fn from_leaf<T: FullLeaf>(leaf: &T) -> Self[src]

Convert a concrete MMR leaf into an opaque type.

pub fn from_encoded_leaf(encoded_leaf: Vec<u8>) -> Self[src]

Create a OpaqueLeaf given raw bytes of compact-encoded leaf.

Trait Implementations

impl Clone for OpaqueLeaf[src]

impl Debug for OpaqueLeaf[src]

impl<'de> Deserialize<'de> for OpaqueLeaf[src]

impl FullLeaf for OpaqueLeaf[src]

impl PartialEq<OpaqueLeaf> for OpaqueLeaf[src]

impl Serialize for OpaqueLeaf[src]

impl StructuralPartialEq for OpaqueLeaf[src]

Auto Trait Implementations

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> CheckedConversion for T[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> DynClone for T where
    T: Clone
[src]

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

impl<T> Instrument for T[src]

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

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

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> MaybeSerialize for T where
    T: Serialize
[src]

impl<T> MaybeSerializeDeserialize for T where
    T: DeserializeOwned + Serialize
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 

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