Enum holochain_types::dht_op::DhtOp
source · pub enum DhtOp {
StoreRecord(Signature, Action, Option<Box<Entry>>),
StoreEntry(Signature, NewEntryAction, Box<Entry>),
RegisterAgentActivity(Signature, Action),
RegisterUpdatedContent(Signature, Update, Option<Box<Entry>>),
RegisterUpdatedRecord(Signature, Update, Option<Box<Entry>>),
RegisterDeletedBy(Signature, Delete),
RegisterDeletedEntryAction(Signature, Delete),
RegisterAddLink(Signature, CreateLink),
RegisterRemoveLink(Signature, DeleteLink),
}
Expand description
A unit of DHT gossip. Used to notify an authority of new (meta)data to hold as well as changes to the status of already held data.
Variants§
StoreRecord(Signature, Action, Option<Box<Entry>>)
Used to notify the authority for an action that it has been created.
Conceptually, authorities receiving this DhtOp
do three things:
- Ensure that the record passes validation.
- Store the action into their DHT shard.
- Store the entry into their CAS.
- Note: they do not become responsible for keeping the set of references from that entry up-to-date.
StoreEntry(Signature, NewEntryAction, Box<Entry>)
Used to notify the authority for an entry that it has been created anew. (The same entry can be created more than once.)
Conceptually, authorities receiving this DhtOp
do four things:
- Ensure that the record passes validation.
- Store the entry into their DHT shard.
- Store the action into their CAS.
- Note: they do not become responsible for keeping the set of references from that action up-to-date.
- Add a “created-by” reference from the entry to the hash of the action.
TODO: document how those “created-by” references are stored in reality.
RegisterAgentActivity(Signature, Action)
Used to notify the authority for an agent’s public key that that agent has committed a new action.
Conceptually, authorities receiving this DhtOp
do three things:
- Ensure that the action alone passes surface-level validation.
- Store the action into their DHT shard.
- FIXME: @artbrock, do they?
- Add an “agent-activity” reference from the public key to the hash of the action.
TODO: document how those “agent-activity” references are stored in reality.
RegisterUpdatedContent(Signature, Update, Option<Box<Entry>>)
Op for updating an entry. This is sent to the entry authority.
RegisterUpdatedRecord(Signature, Update, Option<Box<Entry>>)
Op for updating a record. This is sent to the record authority.
RegisterDeletedBy(Signature, Delete)
Op for registering an action deletion with the Action authority
RegisterDeletedEntryAction(Signature, Delete)
Op for registering an action deletion with the Entry authority, so that the Entry can be marked Dead if all of its Actions have been deleted
RegisterAddLink(Signature, CreateLink)
Op for adding a link
RegisterRemoveLink(Signature, DeleteLink)
Op for removing a link
Implementations§
source§impl DhtOp
impl DhtOp
Mutable access to the Author
sourcepub fn timestamp_mut(&mut self) -> &mut Timestamp
pub fn timestamp_mut(&mut self) -> &mut Timestamp
Mutable access to the Timestamp
sourcepub fn signature_mut(&mut self) -> &mut Signature
pub fn signature_mut(&mut self) -> &mut Signature
Mutable access to the Signature
sourcepub fn action_seq_mut(&mut self) -> Option<&mut u32>
pub fn action_seq_mut(&mut self) -> Option<&mut u32>
Mutable access to the seq of the Action, if applicable
sourcepub fn action_entry_data_mut(
&mut self
) -> Option<(&mut EntryHash, &mut EntryType)>
pub fn action_entry_data_mut( &mut self ) -> Option<(&mut EntryHash, &mut EntryType)>
Mutable access to the entry data of the Action, if applicable
source§impl DhtOp
impl DhtOp
sourcepub fn dht_basis(&self) -> OpBasis
pub fn dht_basis(&self) -> OpBasis
Returns the basis hash which determines which agents will receive this DhtOp
sourcepub fn to_light(&self) -> DhtOpLight
pub fn to_light(&self) -> DhtOpLight
Convert a DhtOp to a DhtOpLight and basis
sourcepub fn into_inner(self) -> (Signature, Action, Option<Entry>)
pub fn into_inner(self) -> (Signature, Action, Option<Entry>)
Extract inner Signature, Action and Option<Entry>
from an op
sourcepub fn action(&self) -> Action
pub fn action(&self) -> Action
Get the action from this op This requires cloning and converting the action as some ops don’t hold the Action type
sourcepub fn from_type(
op_type: DhtOpType,
action: SignedAction,
entry: Option<Entry>
) -> DhtOpResult<Self>
pub fn from_type( op_type: DhtOpType, action: SignedAction, entry: Option<Entry> ) -> DhtOpResult<Self>
From a type, action and an entry (if there is one)
sourcepub fn enzymatic_countersigning_enzyme(&self) -> Option<&AgentPubKey>
pub fn enzymatic_countersigning_enzyme(&self) -> Option<&AgentPubKey>
Enzymatic countersigning session ops need special handling so that they arrive at the enzyme and not elsewhere. If this isn’t an enzymatic countersigning session then the return will be None so can be used as a boolean for filtering with is_some().
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for DhtOp
impl<'arbitrary> Arbitrary<'arbitrary> for DhtOp
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moresource§impl<'de> Deserialize<'de> for DhtOp
impl<'de> Deserialize<'de> for DhtOp
source§fn 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>,
source§impl HashableContent for DhtOp
impl HashableContent for DhtOp
source§fn hashable_content(&self) -> HashableContentBytes
fn hashable_content(&self) -> HashableContentBytes
source§impl OpRegion<RegionData> for DhtOp
impl OpRegion<RegionData> for DhtOp
source§fn region_data(&self) -> RegionData
fn region_data(&self) -> RegionData
source§fn bound(_timestamp: Timestamp, _loc: Loc) -> Self
fn bound(_timestamp: Timestamp, _loc: Loc) -> Self
source§fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
source§impl Ord for DhtOp
impl Ord for DhtOp
source§impl PartialEq<DhtOp> for DhtOp
impl PartialEq<DhtOp> for DhtOp
source§impl PartialOrd<DhtOp> for DhtOp
impl PartialOrd<DhtOp> for DhtOp
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<&DhtOp> for SerializedBytes
impl TryFrom<&DhtOp> for SerializedBytes
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(t: &DhtOp) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &DhtOp) -> Result<SerializedBytes, SerializedBytesError>
source§impl TryFrom<DhtOp> for SerializedBytes
impl TryFrom<DhtOp> for SerializedBytes
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(t: DhtOp) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: DhtOp) -> Result<SerializedBytes, SerializedBytesError>
source§impl TryFrom<SerializedBytes> for DhtOp
impl TryFrom<SerializedBytes> for DhtOp
§type Error = SerializedBytesError
type Error = SerializedBytesError
source§fn try_from(sb: SerializedBytes) -> Result<DhtOp, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<DhtOp, SerializedBytesError>
impl Eq for DhtOp
impl StructuralEq for DhtOp
impl StructuralPartialEq for DhtOp
Auto Trait Implementations§
impl RefUnwindSafe for DhtOp
impl Send for DhtOp
impl Sync for DhtOp
impl Unpin for DhtOp
impl UnwindSafe for DhtOp
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere 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>
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T, C> HashableContentExtSync<T> for Cwhere
T: HashTypeSync,
C: HashableContent<HashType = T>,
impl<T, C> HashableContentExtSync<T> for Cwhere T: HashTypeSync, C: HashableContent<HashType = T>,
source§fn into_hashed(self) -> HoloHashed<C>
fn into_hashed(self) -> HoloHashed<C>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.