[−][src]Struct holochain_core_types::chain_header::ChainHeader
ChainHeader of a source chain "Item" The hash 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
Methods
impl ChainHeader
[src]
impl ChainHeader
pub fn new(
entry_type: &EntryType,
entry_address: &Address,
entry_signature: &Signature,
link: &Option<Address>,
link_same_type: &Option<Address>,
timestamp: &Iso8601
) -> Self
[src]
pub fn new(
entry_type: &EntryType,
entry_address: &Address,
entry_signature: &Signature,
link: &Option<Address>,
link_same_type: &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 from_json_str(header_str: &str) -> Result<Self>
[src]
pub fn from_json_str(header_str: &str) -> Result<Self>
pub fn entry_type(&self) -> &EntryType
[src]
pub fn entry_type(&self) -> &EntryType
entry_type getter
pub fn timestamp(&self) -> &Iso8601
[src]
pub fn timestamp(&self) -> &Iso8601
timestamp getter
pub fn link(&self) -> Option<Address>
[src]
pub fn link(&self) -> Option<Address>
link getter
pub fn entry_address(&self) -> &Address
[src]
pub fn entry_address(&self) -> &Address
entry_address getter
pub fn link_same_type(&self) -> Option<Address>
[src]
pub fn link_same_type(&self) -> Option<Address>
link_same_type getter
pub fn entry_signature(&self) -> &Signature
[src]
pub fn entry_signature(&self) -> &Signature
entry_signature getter
Trait Implementations
impl AddressableContent for ChainHeader
[src]
impl AddressableContent for ChainHeader
fn content(&self) -> Content
[src]
fn content(&self) -> Content
the Content that would be stored in a ContentAddressableStorage
fn from_content(content: &Content) -> Self
[src]
fn from_content(content: &Content) -> Self
restore/deserialize the original struct/type from serialized Content
fn address(&self) -> Address
[src]
fn address(&self) -> Address
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
impl ToEntry for ChainHeader
[src]
impl ToEntry for ChainHeader
impl ToJson for ChainHeader
[src]
impl ToJson for ChainHeader
fn to_json(&self) -> Result<String, HolochainError>
[src]
fn to_json(&self) -> Result<String, HolochainError>
serialize self to a canonical JSON string
impl Clone for ChainHeader
[src]
impl Clone for ChainHeader
fn clone(&self) -> ChainHeader
[src]
fn clone(&self) -> ChainHeader
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq<ChainHeader> for ChainHeader
[src]
impl PartialEq<ChainHeader> for ChainHeader
fn eq(&self, other: &ChainHeader) -> bool
[src]
fn eq(&self, other: &ChainHeader) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Debug for ChainHeader
[src]
impl Debug for ChainHeader
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Serialize for ChainHeader
[src]
impl Serialize for ChainHeader
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for ChainHeader
[src]
impl<'de> Deserialize<'de> for ChainHeader
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl Send for ChainHeader
impl Send for ChainHeader
impl Sync for ChainHeader
impl Sync for ChainHeader
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Same for T
[src]
impl<T> Same for T
type Output = T
Should always be Self
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,