Enum holochain_zome_types::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
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
sourcefn 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
sourcefn 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
sourceimpl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
sourcefn 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
sourceimpl<'_> From<&'_ Header> for HeaderType
impl<'_> From<&'_ Header> for HeaderType
sourcefn from(header: &Header) -> HeaderType
fn from(header: &Header) -> HeaderType
Converts to this type from the input type.
sourceimpl From<EntryCreationHeader> for Header
impl From<EntryCreationHeader> for Header
sourcefn from(e: EntryCreationHeader) -> Header
fn from(e: EntryCreationHeader) -> Header
Converts to this type from the input type.
sourceimpl From<HoloHashed<Header>> for Header
impl From<HoloHashed<Header>> for Header
sourcefn from(header_hashed: HoloHashed<Header>) -> Header
fn from(header_hashed: HoloHashed<Header>) -> Header
Converts to this type from the input type.
sourceimpl<I> From<I> for Header where
I: HeaderInner,
impl<I> From<I> for Header where
I: HeaderInner,
sourceimpl From<SignedHashed<Header>> for Header
impl From<SignedHashed<Header>> for Header
sourcefn from(signed_header_hashed: SignedHashed<Header>) -> Header
fn from(signed_header_hashed: SignedHashed<Header>) -> Header
Converts to this type from the input type.
sourceimpl HashableContent for Header
impl HashableContent for Header
sourcefn hash_type(&self) -> <Header as HashableContent>::HashType
fn hash_type(&self) -> <Header as HashableContent>::HashType
The HashType which this content will be hashed to
sourcefn 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 HeaderExt for Header
impl HeaderExt for Header
fn rebase_on(
&mut self,
new_prev_header: HeaderHash,
new_prev_seq: u32,
new_prev_timestamp: Timestamp
) -> Result<(), HeaderError>
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 HeaderHash>
fn prev_header_mut(&mut self) -> Option<&mut HeaderHash>
returns the previous header except for the DNA header which doesn’t have a previous
fn entry_data_mut(&mut self) -> Option<(&mut EntryHash, &mut EntryType)>
sourceimpl Serialize for Header
impl Serialize for Header
sourcefn 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
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.
sourcefn try_from(t: &Header) -> Result<SerializedBytes, SerializedBytesError>
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.
sourcefn 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.
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.
sourcefn 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 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.
sourcefn 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.
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.
sourcefn 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.
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.
sourcefn try_from(t: Header) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: Header) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
sourceimpl 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.
sourcefn 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.
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.
sourcefn 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
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
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.
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> 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.
sourcefn clone_into(&self, target: &mut T)
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>,
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