Enum holochain_types::dht_op::DhtOp
source · pub enum DhtOp {
StoreRecord(Signature, Action, RecordEntry),
StoreEntry(Signature, NewEntryAction, Entry),
RegisterAgentActivity(Signature, Action),
RegisterUpdatedContent(Signature, Update, RecordEntry),
RegisterUpdatedRecord(Signature, Update, RecordEntry),
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, RecordEntry)
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, 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, RecordEntry)
Op for updating an entry. This is sent to the entry authority.
RegisterUpdatedRecord(Signature, Update, RecordEntry)
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
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 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 entry(&self) -> RecordEntryRef<'_>
pub fn entry(&self) -> RecordEntryRef<'_>
Get the entry from this op, if one exists
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().
sourcepub fn sys_validation_dependency(&self) -> SysValDep
pub fn sys_validation_dependency(&self) -> SysValDep
Calculate the op’s sys validation dependency action hash
Trait Implementations§
source§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 for DhtOp
impl OpRegion 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 for DhtOp
impl PartialEq for DhtOp
source§impl PartialOrd for DhtOp
impl PartialOrd 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 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
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§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>
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§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.