Enum holochain_integrity_types::action::Action
source · [−]pub enum Action {
Dna(Dna),
AgentValidationPkg(AgentValidationPkg),
InitZomesComplete(InitZomesComplete),
CreateLink(CreateLink),
DeleteLink(DeleteLink),
OpenChain(OpenChain),
CloseChain(CloseChain),
Create(Create),
Update(Update),
Delete(Delete),
}
Expand description
Action contains variants for each type of action.
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 Action
impl Action
sourcepub fn entry_data(&self) -> Option<(&EntryHash, &EntryType)>
pub fn entry_data(&self) -> Option<(&EntryHash, &EntryType)>
Returns the address and entry type of the Entry, if applicable.
sourcepub fn into_entry_data(self) -> Option<(EntryHash, EntryType)>
pub fn into_entry_data(self) -> Option<(EntryHash, EntryType)>
Pull out the entry data by move.
pub fn entry_hash(&self) -> Option<&EntryHash>
pub fn entry_type(&self) -> Option<&EntryType>
pub fn action_type(&self) -> ActionType
returns the public key of the agent who signed this action.
sourcepub fn action_seq(&self) -> u32
pub fn action_seq(&self) -> u32
returns the sequence ordinal of this action
sourcepub fn prev_action(&self) -> Option<&ActionHash>
pub fn prev_action(&self) -> Option<&ActionHash>
returns the previous action except for the DNA action which doesn’t have a previous
pub fn is_genesis(&self) -> bool
pub fn rate_data(&self) -> RateWeight
pub fn entry_rate_data(&self) -> Option<EntryRateWeight>
sourceimpl Action
impl Action
sourcepub fn from_countersigning_data(
entry_hash: EntryHash,
session_data: &CounterSigningSessionData,
author: AgentPubKey,
weight: EntryRateWeight
) -> Result<Self, CounterSigningError>
pub fn from_countersigning_data(
entry_hash: EntryHash,
session_data: &CounterSigningSessionData,
author: AgentPubKey,
weight: EntryRateWeight
) -> Result<Self, CounterSigningError>
Construct an Action from the ActionBase and associated session data.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<&Action> for ActionType
impl From<&Action> for ActionType
sourcefn from(action: &Action) -> ActionType
fn from(action: &Action) -> ActionType
Converts to this type from the input type.
sourceimpl From<EntryCreationAction> for Action
impl From<EntryCreationAction> for Action
sourcefn from(e: EntryCreationAction) -> Self
fn from(e: EntryCreationAction) -> Self
Converts to this type from the input type.
sourceimpl From<HoloHashed<Action>> for Action
impl From<HoloHashed<Action>> for Action
sourcefn from(action_hashed: ActionHashed) -> Action
fn from(action_hashed: ActionHashed) -> Action
Converts to this type from the input type.
sourceimpl<I: ActionWeighed> From<I> for Action
impl<I: ActionWeighed> From<I> for Action
sourceimpl From<SignedHashed<Action>> for Action
impl From<SignedHashed<Action>> for Action
sourcefn from(signed_action_hashed: SignedActionHashed) -> Action
fn from(signed_action_hashed: SignedActionHashed) -> Action
Converts to this type from the input type.
sourceimpl HashableContent for Action
impl HashableContent for Action
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<'a> TryFrom<&'a Action> for &'a CreateLink
impl<'a> TryFrom<&'a Action> for &'a CreateLink
sourceimpl<'a> TryFrom<&'a Action> for &'a DeleteLink
impl<'a> TryFrom<&'a Action> for &'a DeleteLink
sourceimpl TryFrom<&Action> for SerializedBytes
impl TryFrom<&Action> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcefn try_from(t: &Action) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &Action) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
sourceimpl TryFrom<Action> for CreateLink
impl TryFrom<Action> for CreateLink
sourceimpl TryFrom<Action> for DeleteLink
impl TryFrom<Action> for DeleteLink
sourceimpl TryFrom<Action> for SerializedBytes
impl TryFrom<Action> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcefn try_from(t: Action) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: Action) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
sourceimpl TryFrom<Action> for EntryCreationAction
impl TryFrom<Action> for EntryCreationAction
sourceimpl TryFrom<SerializedBytes> for Action
impl TryFrom<SerializedBytes> for Action
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcefn try_from(sb: SerializedBytes) -> Result<Action, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<Action, SerializedBytesError>
Performs the conversion.
impl Eq for Action
impl StructuralEq for Action
impl StructuralPartialEq for Action
Auto Trait Implementations
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnwindSafe for Action
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.