Enum holochain_types::prelude::header::Header
[−]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
impl Header
impl Header
pub 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.
impl Header
impl Header
pub 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 into_entry_data(self) -> Option<(HoloHash<Entry>, EntryType)>
pub fn into_entry_data(self) -> Option<(HoloHash<Entry>, EntryType)>
Pull out the entry data by move.
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.
pub fn header_seq(&self) -> u32
pub fn header_seq(&self) -> u32
returns the sequence ordinal of this header
pub 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
impl<'arbitrary> Arbitrary<'arbitrary> for Header
impl<'arbitrary> Arbitrary<'arbitrary> for Header
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Header, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Header, Error>
Generate an arbitrary value of Self
from the given unstructured data. Read more
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Header, Error>
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
impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
fn deserialize<__D>(
__deserializer: __D
) -> Result<Header, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
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
impl<'_> From<&'_ Header> for HeaderType
impl<'_> From<&'_ Header> for HeaderType
fn from(header: &Header) -> HeaderType
fn from(header: &Header) -> HeaderType
Converts to this type from the input type.
impl From<EntryCreationHeader> for Header
impl From<EntryCreationHeader> for Header
fn from(e: EntryCreationHeader) -> Header
fn from(e: EntryCreationHeader) -> Header
Converts to this type from the input type.
impl From<HoloHashed<Header>> for Header
impl From<HoloHashed<Header>> for Header
fn from(header_hashed: HoloHashed<Header>) -> Header
fn from(header_hashed: HoloHashed<Header>) -> Header
Converts to this type from the input type.
impl<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
Converts to this type from the input type.
impl From<SignedHashed<Header>> for Header
impl From<SignedHashed<Header>> for Header
fn from(signed_header_hashed: SignedHashed<Header>) -> Header
fn from(signed_header_hashed: SignedHashed<Header>) -> Header
Converts to this type from the input type.
impl HashableContent for Header
impl HashableContent for Header
fn hash_type(&self) -> <Header as HashableContent>::HashType
fn hash_type(&self) -> <Header as HashableContent>::HashType
The HashType which this content will be hashed to
fn hashable_content(&self) -> HashableContentBytes
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 HeaderRefMut for Header
impl HeaderRefMut for Header
Some necessary extra mutators for lenses/prisms over Headers
returns a mutable reference to the author
sourcefn header_seq_mut(&mut self) -> Option<&mut u32>
fn header_seq_mut(&mut self) -> Option<&mut u32>
returns a mutable reference to the sequence ordinal of this header
sourcefn prev_header_mut(&mut self) -> Option<&mut HoloHash<Header>>
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
fn entry_data_mut(&mut self) -> Option<(&mut HoloHash<Entry>, &mut EntryType)>
impl Serialize for Header
impl Serialize for Header
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
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
impl<'_> 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.
fn try_from(t: &Header) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &Header) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
impl<'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.
fn try_from(
value: &'a Header
) -> Result<&'a CreateLink, <&'a CreateLink as TryFrom<&'a Header>>::Error>
fn try_from(
value: &'a Header
) -> Result<&'a CreateLink, <&'a CreateLink as TryFrom<&'a Header>>::Error>
Performs the conversion.
impl<'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.
fn try_from(
value: &'a Header
) -> Result<&'a DeleteLink, <&'a DeleteLink as TryFrom<&'a Header>>::Error>
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>
impl 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.
fn try_from(
value: Header
) -> Result<CreateLink, <CreateLink as TryFrom<Header>>::Error>
fn try_from(
value: Header
) -> Result<CreateLink, <CreateLink as TryFrom<Header>>::Error>
Performs the conversion.
impl TryFrom<Header> for EntryCreationHeader
impl TryFrom<Header> for EntryCreationHeader
type Error = WrongHeaderError
type Error = WrongHeaderError
The type returned in the event of a conversion error.
fn try_from(
value: Header
) -> Result<EntryCreationHeader, <EntryCreationHeader as TryFrom<Header>>::Error>
fn try_from(
value: Header
) -> Result<EntryCreationHeader, <EntryCreationHeader as TryFrom<Header>>::Error>
Performs the conversion.
impl 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.
fn try_from(
value: Header
) -> Result<DeleteLink, <DeleteLink as TryFrom<Header>>::Error>
fn try_from(
value: Header
) -> Result<DeleteLink, <DeleteLink as TryFrom<Header>>::Error>
Performs the conversion.
impl 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.
fn try_from(t: Header) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: Header) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
sourceimpl TryFrom<Header> for NewEntryHeader
impl TryFrom<Header> for NewEntryHeader
impl 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.
fn try_from(sb: SerializedBytes) -> Result<Header, SerializedBytesError>
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> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
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,
sourcefn equivalent(&self, key: &K) -> bool
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>,
sourcefn into_hashed(self) -> HoloHashed<C>
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
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
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