pub enum Action {
Dna(Dna),
AgentValidationPkg(AgentValidationPkg),
InitZomesComplete(InitZomesComplete),
CreateLink(CreateLink),
DeleteLink(DeleteLink),
CloseChain(CloseChain),
OpenChain(OpenChain),
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)
CloseChain(CloseChain)
OpenChain(OpenChain)
Create(Create)
Update(Update)
Delete(Delete)
Implementations§
Source§impl Action
impl Action
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.
Sourcepub 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_visibility(&self) -> Option<&EntryVisibility>
pub fn entry_hash(&self) -> Option<&HoloHash<Entry>>
pub fn entry_type(&self) -> Option<&EntryType>
pub fn action_type(&self) -> ActionType
Returns the public key of the agent who “authored” this action. NOTE: This is not necessarily the agent who signed the action.
Sourcepub fn signer(&self) -> &HoloHash<Agent>
pub fn signer(&self) -> &HoloHash<Agent>
Returns the public key of the agent who signed this action. NOTE: this is not necessarily the agent who “authored” the 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<&HoloHash<Action>>
pub fn prev_action(&self) -> Option<&HoloHash<Action>>
returns the previous action except for the DNA action which doesn’t have a previous
Sourcepub fn prev_action_mut(&mut self) -> Option<&mut HoloHash<Action>>
pub fn prev_action_mut(&mut self) -> Option<&mut HoloHash<Action>>
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>
Source§impl Action
impl Action
Sourcepub fn from_countersigning_data(
entry_hash: HoloHash<Entry>,
session_data: &CounterSigningSessionData,
author: HoloHash<Agent>,
weight: EntryRateWeight,
) -> Result<Action, CounterSigningError>
pub fn from_countersigning_data( entry_hash: HoloHash<Entry>, session_data: &CounterSigningSessionData, author: HoloHash<Agent>, weight: EntryRateWeight, ) -> Result<Action, CounterSigningError>
Construct an Action from the ActionBase and associated session data.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Action, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Action, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<&Action> for ActionType
impl From<&Action> for ActionType
Source§fn from(action: &Action) -> ActionType
fn from(action: &Action) -> ActionType
Source§impl From<EntryCreationAction> for Action
impl From<EntryCreationAction> for Action
Source§fn from(e: EntryCreationAction) -> Action
fn from(e: EntryCreationAction) -> Action
Source§impl<I> From<I> for Actionwhere
I: ActionWeighed,
impl<I> From<I> for Actionwhere
I: ActionWeighed,
Source§impl HashableContent for Action
impl HashableContent for Action
Source§fn hash_type(&self) -> <Action as HashableContent>::HashType
fn hash_type(&self) -> <Action as HashableContent>::HashType
Source§fn hashable_content(&self) -> HashableContentBytes
fn hashable_content(&self) -> HashableContentBytes
Source§impl Serialize for Action
impl Serialize for Action
Source§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,
Source§impl<'a> TryFrom<&'a Action> for &'a CreateLink
impl<'a> TryFrom<&'a Action> for &'a CreateLink
Source§type Error = WrongActionError
type Error = WrongActionError
Source§fn try_from(
value: &'a Action,
) -> Result<&'a CreateLink, <&'a CreateLink as TryFrom<&'a Action>>::Error>
fn try_from( value: &'a Action, ) -> Result<&'a CreateLink, <&'a CreateLink as TryFrom<&'a Action>>::Error>
Source§impl<'a> TryFrom<&'a Action> for &'a DeleteLink
impl<'a> TryFrom<&'a Action> for &'a DeleteLink
Source§type Error = WrongActionError
type Error = WrongActionError
Source§fn try_from(
value: &'a Action,
) -> Result<&'a DeleteLink, <&'a DeleteLink as TryFrom<&'a Action>>::Error>
fn try_from( value: &'a Action, ) -> Result<&'a DeleteLink, <&'a DeleteLink as TryFrom<&'a Action>>::Error>
Source§impl TryFrom<&Action> for SerializedBytes
impl TryFrom<&Action> for SerializedBytes
Source§type Error = SerializedBytesError
type Error = SerializedBytesError
Source§fn try_from(t: &Action) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &Action) -> Result<SerializedBytes, SerializedBytesError>
Source§impl TryFrom<Action> for CreateLink
impl TryFrom<Action> for CreateLink
Source§type Error = WrongActionError
type Error = WrongActionError
Source§fn try_from(
value: Action,
) -> Result<CreateLink, <CreateLink as TryFrom<Action>>::Error>
fn try_from( value: Action, ) -> Result<CreateLink, <CreateLink as TryFrom<Action>>::Error>
Source§impl TryFrom<Action> for DeleteLink
impl TryFrom<Action> for DeleteLink
Source§type Error = WrongActionError
type Error = WrongActionError
Source§fn try_from(
value: Action,
) -> Result<DeleteLink, <DeleteLink as TryFrom<Action>>::Error>
fn try_from( value: Action, ) -> Result<DeleteLink, <DeleteLink as TryFrom<Action>>::Error>
Source§impl TryFrom<Action> for EntryCreationAction
impl TryFrom<Action> for EntryCreationAction
Source§type Error = WrongActionError
type Error = WrongActionError
Source§fn try_from(
value: Action,
) -> Result<EntryCreationAction, <EntryCreationAction as TryFrom<Action>>::Error>
fn try_from( value: Action, ) -> Result<EntryCreationAction, <EntryCreationAction as TryFrom<Action>>::Error>
Source§impl TryFrom<Action> for SerializedBytes
impl TryFrom<Action> for SerializedBytes
Source§type Error = SerializedBytesError
type Error = SerializedBytesError
Source§fn try_from(t: Action) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: Action) -> Result<SerializedBytes, SerializedBytesError>
Source§impl TryFrom<SerializedBytes> for Action
impl TryFrom<SerializedBytes> for Action
Source§type Error = SerializedBytesError
type Error = SerializedBytesError
Source§fn try_from(sb: SerializedBytes) -> Result<Action, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<Action, SerializedBytesError>
impl Eq for Action
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnwindSafe for Action
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.