Enum holochain_types::prelude::Header
source · [−]pub enum Header {
Dna(Dna),
AgentValidationPkg(AgentValidationPkg),
InitZomesComplete(InitZomesComplete),
CreateLink(CreateLink),
DeleteLink(DeleteLink),
OpenChain(OpenChain),
CloseChain(CloseChain),
Create(Create),
Update(Update),
Delete(Delete),
}
Expand description
Header contains variants for each type of header.
This struct really defines a local source chain, in the sense that it implements the pointers between hashes that a hash chain relies on, which are then used to check the integrity of data using cryptographic hash functions.
Variants
Dna(Dna)
AgentValidationPkg(AgentValidationPkg)
InitZomesComplete(InitZomesComplete)
CreateLink(CreateLink)
DeleteLink(DeleteLink)
OpenChain(OpenChain)
CloseChain(CloseChain)
Create(Create)
Update(Update)
Delete(Delete)
Implementations
sourceimpl Header
impl Header
sourcepub fn from_countersigning_data(
entry_hash: HoloHash<Entry>,
session_data: &CounterSigningSessionData,
author: HoloHash<Agent>
) -> Result<Header, CounterSigningError>
pub fn from_countersigning_data(
entry_hash: HoloHash<Entry>,
session_data: &CounterSigningSessionData,
author: HoloHash<Agent>
) -> Result<Header, CounterSigningError>
Construct a Header from the HeaderBase and associated session data.
sourceimpl Header
impl Header
Some necessary extra mutators for lenses/prisms over Headers
returns a mutable reference to the author
sourcepub fn header_seq_mut(&mut self) -> Option<&mut u32>
pub fn header_seq_mut(&mut self) -> Option<&mut u32>
returns a mutable reference to the sequence ordinal of this header
sourcepub fn prev_header_mut(&mut self) -> Option<&mut HoloHash<Header>>
pub fn prev_header_mut(&mut self) -> Option<&mut HoloHash<Header>>
returns the previous header except for the DNA header which doesn’t have a previous
pub fn entry_data_mut(
&mut self
) -> Option<(&mut HoloHash<Entry>, &mut EntryType)>
sourceimpl Header
impl Header
sourcepub fn entry_data(&self) -> Option<(&HoloHash<Entry>, &EntryType)>
pub fn entry_data(&self) -> Option<(&HoloHash<Entry>, &EntryType)>
Returns the address and entry type of the Entry, if applicable.
pub fn entry_hash(&self) -> Option<&HoloHash<Entry>>
pub fn entry_type(&self) -> Option<&EntryType>
pub fn header_type(&self) -> HeaderType
returns the public key of the agent who signed this header.
sourcepub fn header_seq(&self) -> u32
pub fn header_seq(&self) -> u32
returns the sequence ordinal of this header
sourcepub fn prev_header(&self) -> Option<&HoloHash<Header>>
pub fn prev_header(&self) -> Option<&HoloHash<Header>>
returns the previous header except for the DNA header which doesn’t have a previous
pub fn is_genesis(&self) -> bool
Trait Implementations
sourceimpl<'arbitrary> Arbitrary<'arbitrary> for Header
impl<'arbitrary> Arbitrary<'arbitrary> for Header
sourcepub fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Header, Error>
pub fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Header, Error>
Generate an arbitrary value of Self
from the given unstructured data. Read more
sourcepub fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Header, Error>
pub fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Header, Error>
Generate an arbitrary value of Self
from the entirety of the given unstructured data. Read more
sourceimpl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
sourcepub fn deserialize<__D>(
__deserializer: __D
) -> Result<Header, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Header, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<&'_ Header> for HeaderType
impl From<&'_ Header> for HeaderType
sourcepub fn from(header: &Header) -> HeaderType
pub fn from(header: &Header) -> HeaderType
Performs the conversion.
sourceimpl From<HoloHashed<Header>> for Header
impl From<HoloHashed<Header>> for Header
sourcepub fn from(header_hashed: HoloHashed<Header>) -> Header
pub fn from(header_hashed: HoloHashed<Header>) -> Header
Performs the conversion.
sourceimpl<I> From<I> for Header where
I: HeaderInner,
impl<I> From<I> for Header where
I: HeaderInner,
sourceimpl From<NewEntryHeader> for Header
impl From<NewEntryHeader> for Header
sourcefn from(h: NewEntryHeader) -> Self
fn from(h: NewEntryHeader) -> Self
Performs the conversion.
sourceimpl From<SignedHeaderHashed> for Header
impl From<SignedHeaderHashed> for Header
sourcepub fn from(signed_header_hashed: SignedHeaderHashed) -> Header
pub fn from(signed_header_hashed: SignedHeaderHashed) -> Header
Performs the conversion.
sourceimpl HashableContent for Header
impl HashableContent for Header
sourcepub fn hash_type(&self) -> <Header as HashableContent>::HashType
pub fn hash_type(&self) -> <Header as HashableContent>::HashType
The HashType which this content will be hashed to
sourcepub fn hashable_content(&self) -> HashableContentBytes
pub fn hashable_content(&self) -> HashableContentBytes
Return a subset of the content, either as SerializedBytes “content”, which will be used to compute the hash, or as an already precomputed hash which will be used directly Read more
sourceimpl Serialize for Header
impl Serialize for Header
sourcepub 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
sourceimpl TryFrom<&'_ Header> for SerializedBytes
impl TryFrom<&'_ Header> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcepub fn try_from(t: &Header) -> Result<SerializedBytes, SerializedBytesError>
pub fn try_from(t: &Header) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
sourceimpl<'a> TryFrom<&'a Header> for &'a CreateLink
impl<'a> TryFrom<&'a Header> for &'a CreateLink
type Error = WrongHeaderError
type Error = WrongHeaderError
The type returned in the event of a conversion error.
sourcepub fn try_from(
value: &'a Header
) -> Result<&'a CreateLink, <&'a CreateLink as TryFrom<&'a Header>>::Error>
pub fn try_from(
value: &'a Header
) -> Result<&'a CreateLink, <&'a CreateLink as TryFrom<&'a Header>>::Error>
Performs the conversion.
sourceimpl<'a> TryFrom<&'a Header> for &'a DeleteLink
impl<'a> TryFrom<&'a Header> for &'a DeleteLink
type Error = WrongHeaderError
type Error = WrongHeaderError
The type returned in the event of a conversion error.
sourcepub fn try_from(
value: &'a Header
) -> Result<&'a DeleteLink, <&'a DeleteLink as TryFrom<&'a Header>>::Error>
pub fn try_from(
value: &'a Header
) -> Result<&'a DeleteLink, <&'a DeleteLink as TryFrom<&'a Header>>::Error>
Performs the conversion.
sourceimpl<'a> TryFrom<&'a Header> for NewEntryHeaderRef<'a>
impl<'a> TryFrom<&'a Header> for NewEntryHeaderRef<'a>
sourceimpl TryFrom<Header> for DeleteLink
impl TryFrom<Header> for DeleteLink
type Error = WrongHeaderError
type Error = WrongHeaderError
The type returned in the event of a conversion error.
sourcepub fn try_from(
value: Header
) -> Result<DeleteLink, <DeleteLink as TryFrom<Header>>::Error>
pub fn try_from(
value: Header
) -> Result<DeleteLink, <DeleteLink as TryFrom<Header>>::Error>
Performs the conversion.
sourceimpl TryFrom<Header> for CreateLink
impl TryFrom<Header> for CreateLink
type Error = WrongHeaderError
type Error = WrongHeaderError
The type returned in the event of a conversion error.
sourcepub fn try_from(
value: Header
) -> Result<CreateLink, <CreateLink as TryFrom<Header>>::Error>
pub fn try_from(
value: Header
) -> Result<CreateLink, <CreateLink as TryFrom<Header>>::Error>
Performs the conversion.
sourceimpl TryFrom<Header> for SerializedBytes
impl TryFrom<Header> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcepub fn try_from(t: Header) -> Result<SerializedBytes, SerializedBytesError>
pub fn try_from(t: Header) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
sourceimpl TryFrom<Header> for NewEntryHeader
impl TryFrom<Header> for NewEntryHeader
sourceimpl TryFrom<SerializedBytes> for Header
impl TryFrom<SerializedBytes> for Header
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcepub fn try_from(sb: SerializedBytes) -> Result<Header, SerializedBytesError>
pub fn try_from(sb: SerializedBytes) -> Result<Header, SerializedBytesError>
Performs the conversion.
impl Eq for Header
impl StructuralEq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations
impl<T> Any for T where
T: Any + ?Sized,
impl<T> Any for T where
T: Any + ?Sized,
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove Any::type_id_compat and use StdAny::type_id instead. https://github.com/rust-lang/rust/issues/27745 Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T, C> HashableContentExtSync<T> for C where
T: HashTypeSync,
C: HashableContent<HashType = T>,
impl<T, C> HashableContentExtSync<T> for C where
T: HashTypeSync,
C: HashableContent<HashType = T>,
sourcepub fn into_hashed(self) -> HoloHashed<C>
pub fn into_hashed(self) -> HoloHashed<C>
Move into a HoloHashed
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more