Enum holochain_zome_types::action::Action
source · [−]pub enum Action {
Dna(Dna),
AgentValidationPkg(AgentValidationPkg),
InitZomesComplete(InitZomesComplete),
CreateLink(CreateLink<RateWeight>),
DeleteLink(DeleteLink),
OpenChain(OpenChain),
CloseChain(CloseChain),
Create(Create<EntryRateWeight>),
Update(Update<EntryRateWeight>),
Delete(Delete<RateWeight>),
}
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<RateWeight>)
DeleteLink(DeleteLink)
OpenChain(OpenChain)
CloseChain(CloseChain)
Create(Create<EntryRateWeight>)
Update(Update<EntryRateWeight>)
Delete(Delete<RateWeight>)
Implementations
sourceimpl 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_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 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<&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
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: 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
sourceimpl ActionExt for Action
impl ActionExt for Action
fn rebase_on(
&mut self,
new_prev_action: ActionHash,
new_prev_seq: u32,
new_prev_timestamp: Timestamp
) -> Result<(), ActionError>
sourceimpl ActionRefMut for Action
impl ActionRefMut for Action
Some necessary extra mutators for lenses/prisms over Actions
returns a mutable reference to the author
sourcefn timestamp_mut(&mut self) -> &mut Timestamp
fn timestamp_mut(&mut self) -> &mut Timestamp
returns a mutable reference to the timestamp
sourcefn action_seq_mut(&mut self) -> Option<&mut u32>
fn action_seq_mut(&mut self) -> Option<&mut u32>
returns a mutable reference to the sequence ordinal of this action
sourcefn prev_action_mut(&mut self) -> Option<&mut ActionHash>
fn prev_action_mut(&mut self) -> Option<&mut ActionHash>
returns the previous action except for the DNA action which doesn’t have a previous
fn entry_data_mut(&mut self) -> Option<(&mut EntryHash, &mut EntryType)>
sourceimpl<'arbitrary> Arbitrary<'arbitrary> for Action
impl<'arbitrary> Arbitrary<'arbitrary> for Action
sourcefn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Action, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Action, Error>
Generate an arbitrary value of Self
from the given unstructured data. Read more
sourcefn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Action, Error>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Action, Error>
Generate an arbitrary value of Self
from the entirety of the given
unstructured data. Read more
sourceimpl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
sourcefn 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>,
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) -> Action
fn from(e: EntryCreationAction) -> Action
Converts to this type from the input type.
sourceimpl From<HoloHashed<Action>> for Action
impl From<HoloHashed<Action>> for Action
sourcefn from(action_hashed: HoloHashed<Action>) -> Action
fn from(action_hashed: HoloHashed<Action>) -> Action
Converts to this type from the input type.
sourceimpl<I> From<I> for Action where
I: ActionWeighed,
impl<I> From<I> for Action where
I: ActionWeighed,
sourceimpl From<SignedHashed<Action>> for Action
impl From<SignedHashed<Action>> for Action
sourcefn from(signed_action_hashed: SignedHashed<Action>) -> Action
fn from(signed_action_hashed: SignedHashed<Action>) -> Action
Converts to this type from the input type.
sourceimpl HashableContent for Action
impl HashableContent for Action
sourcefn hash_type(&self) -> <Action as HashableContent>::HashType
fn hash_type(&self) -> <Action 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 Serialize for Action
impl Serialize for Action
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<'a> TryFrom<&'a Action> for &'a CreateLink<RateWeight>
impl<'a> TryFrom<&'a Action> for &'a CreateLink<RateWeight>
type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
sourcefn try_from(
value: &'a Action
) -> Result<&'a CreateLink<RateWeight>, <&'a CreateLink<RateWeight> as TryFrom<&'a Action>>::Error>
fn try_from(
value: &'a Action
) -> Result<&'a CreateLink<RateWeight>, <&'a CreateLink<RateWeight> as TryFrom<&'a Action>>::Error>
Performs the conversion.
sourceimpl<'a> TryFrom<&'a Action> for &'a Delete<RateWeight>
impl<'a> TryFrom<&'a Action> for &'a Delete<RateWeight>
type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
sourceimpl<'a> TryFrom<&'a Action> for &'a DeleteLink
impl<'a> TryFrom<&'a Action> for &'a DeleteLink
type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
sourcefn 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>
Performs the conversion.
sourceimpl<'a> TryFrom<&'a Action> for &'a Update<EntryRateWeight>
impl<'a> TryFrom<&'a Action> for &'a Update<EntryRateWeight>
type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
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<RateWeight>
impl TryFrom<Action> for CreateLink<RateWeight>
type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
sourcefn try_from(
value: Action
) -> Result<CreateLink<RateWeight>, <CreateLink<RateWeight> as TryFrom<Action>>::Error>
fn try_from(
value: Action
) -> Result<CreateLink<RateWeight>, <CreateLink<RateWeight> as TryFrom<Action>>::Error>
Performs the conversion.
sourceimpl TryFrom<Action> for Delete<RateWeight>
impl TryFrom<Action> for Delete<RateWeight>
type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
sourceimpl TryFrom<Action> for DeleteLink
impl TryFrom<Action> for DeleteLink
type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
sourcefn try_from(
value: Action
) -> Result<DeleteLink, <DeleteLink as TryFrom<Action>>::Error>
fn try_from(
value: Action
) -> Result<DeleteLink, <DeleteLink as TryFrom<Action>>::Error>
Performs the conversion.
sourceimpl TryFrom<Action> for EntryCreationAction
impl TryFrom<Action> for EntryCreationAction
type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
sourcefn try_from(
value: Action
) -> Result<EntryCreationAction, <EntryCreationAction as TryFrom<Action>>::Error>
fn try_from(
value: Action
) -> Result<EntryCreationAction, <EntryCreationAction as TryFrom<Action>>::Error>
Performs the conversion.
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 Update<EntryRateWeight>
impl TryFrom<Action> for Update<EntryRateWeight>
type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
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
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
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>
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
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