[][src]Struct holochain_core_types::chain_header::ChainHeader

pub struct ChainHeader { /* fields omitted */ }

ChainHeader of a source chain "Item" The address of the ChainHeader is used as the Item's key in the source chain hash table ChainHeaders are linked to next header in chain and next header of same type in chain


impl ChainHeader[src]

pub fn new(
    entry_type: &EntryType,
    entry_address: &Address,
    provenances: &[Provenance],
    link: &Option<Address>,
    link_same_type: &Option<Address>,
    link_update_delete: &Option<Address>,
    timestamp: &Iso8601
) -> Self

build a new ChainHeader from a chain, entry type and entry. a ChainHeader is immutable, but the chain is mutable if chain.push() is used. this means that a header becomes invalid and useless as soon as the chain is mutated the only valid usage of a header is to immediately push it onto a chain in a Pair. normally (outside unit tests) the generation of valid headers is internal to the chain::SourceChain trait and should not need to be handled manually

@see chain::entry::Entry

pub fn entry_type(&self) -> &EntryType[src]

entry_type getter

pub fn timestamp(&self) -> &Iso8601[src]

timestamp getter

link getter

pub fn entry_address(&self) -> &Address[src]

entry_address getter

link_same_type getter

link_update_delete getter

pub fn provenances(&self) -> &Vec<Provenance>[src]

entry_signature getter

Trait Implementations

impl<'a> From<&'a ChainHeader> for JsonString[src]

impl From<ChainHeader> for JsonString[src]

impl PartialEq<ChainHeader> for ChainHeader[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Clone for ChainHeader[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ChainHeader[src]

impl<'a> TryFrom<&'a JsonString> for ChainHeader[src]

type Error = JsonError

The type returned in the event of a conversion error.

impl TryFrom<JsonString> for ChainHeader[src]

type Error = JsonError

The type returned in the event of a conversion error.

impl Serialize for ChainHeader[src]

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

impl AddressableContent for ChainHeader[src]

fn address(&self) -> HashString

the Address the Content would be available at once stored in a ContentAddressableStorage default implementation is provided as hashing Content with sha256 the default implementation should cover most use-cases it is critical that there are no hash collisions across all stored AddressableContent it is recommended to implement an "address space" prefix for address algorithms that don't offer strong cryptographic guarantees like sha et. al. Read more

Auto Trait Implementations

impl Send for ChainHeader

impl Unpin for ChainHeader

impl Sync for ChainHeader

impl RefUnwindSafe for ChainHeader

impl UnwindSafe for ChainHeader

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

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

impl<T> Clone for T where
    T: Clone