Struct hdk::prelude::HoloHashed
source · [−]pub struct HoloHashed<C> where
C: HashableContent, { /* private fields */ }
Expand description
Represents some piece of content along with its hash representation, so that hashes need not be calculated multiple times. Provides an easy constructor which consumes the content.
Implementations
pub fn with_pre_hashed(
content: C,
hash: HoloHash<<C as HashableContent>::HashType>
) -> HoloHashed<C>
pub fn with_pre_hashed(
content: C,
hash: HoloHash<<C as HashableContent>::HashType>
) -> HoloHashed<C>
Combine content with its precalculated hash
Accessor for content
Convert to content
Deconstruct as a tuple
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<HoloHashed<C>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<HoloHashed<C>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<C> From<HoloHashed<C>> for (C, HoloHash<<C as HashableContent>::HashType>) where
C: HashableContent,
impl<C> From<HoloHashed<C>> for (C, HoloHash<<C as HashableContent>::HashType>) where
C: HashableContent,
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Get the hash by reference
Convert to the owned hash
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl<C> RefUnwindSafe for HoloHashed<C> where
C: RefUnwindSafe,
<C as HashableContent>::HashType: RefUnwindSafe,
impl<C> Send for HoloHashed<C> where
C: Send,
<C as HashableContent>::HashType: Send,
impl<C> Sync for HoloHashed<C> where
C: Sync,
<C as HashableContent>::HashType: Sync,
impl<C> Unpin for HoloHashed<C> where
C: Unpin,
<C as HashableContent>::HashType: Unpin,
impl<C> UnwindSafe for HoloHashed<C> where
C: UnwindSafe,
<C as HashableContent>::HashType: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more