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
sourceimpl 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
sourceimpl DhtOp
impl DhtOp
sourcepub fn dht_basis(&self) -> AnyDhtHash
pub fn dht_basis(&self) -> AnyDhtHash
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
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
sourceimpl<'arbitrary> Arbitrary<'arbitrary> for DhtOp
impl<'arbitrary> Arbitrary<'arbitrary> for DhtOp
sourcefn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of Self
from the given unstructured data. Read more
sourcefn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of Self
from the entirety of the given
unstructured data. Read more
sourceimpl<'de> Deserialize<'de> for DhtOp
impl<'de> Deserialize<'de> for DhtOp
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 HashableContent for DhtOp
impl HashableContent for DhtOp
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 OpRegion<RegionData> for DhtOp
impl OpRegion<RegionData> for DhtOp
sourcefn region_data(&self) -> RegionData
fn region_data(&self) -> RegionData
The RegionData that would be produced if this op were the only op in the region. The sum of these produces the RegionData for the whole region. Read more
sourcefn bound(_timestamp: Timestamp, _loc: Loc) -> Self
fn bound(_timestamp: Timestamp, _loc: Loc) -> Self
Create an Op with arbitrary data but that has the given timestamp and location. Used for bounded range queries based on the PartialOrd impl of the op. Read more
sourcefn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
fn coords(&self, topo: &Topology) -> SpacetimeQuantumCoords
The quantized space and time coordinates, based on the location and timestamp.
sourceimpl Ord for DhtOp
impl Ord for DhtOp
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<DhtOp> for DhtOp
impl PartialOrd<DhtOp> for DhtOp
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl TryFrom<&DhtOp> for SerializedBytes
impl TryFrom<&DhtOp> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcefn try_from(t: &DhtOp) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: &DhtOp) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
sourceimpl TryFrom<DhtOp> for SerializedBytes
impl TryFrom<DhtOp> for SerializedBytes
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcefn try_from(t: DhtOp) -> Result<SerializedBytes, SerializedBytesError>
fn try_from(t: DhtOp) -> Result<SerializedBytes, SerializedBytesError>
Performs the conversion.
sourceimpl TryFrom<SerializedBytes> for DhtOp
impl TryFrom<SerializedBytes> for DhtOp
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
sourcefn try_from(sb: SerializedBytes) -> Result<DhtOp, SerializedBytesError>
fn try_from(sb: SerializedBytes) -> Result<DhtOp, SerializedBytesError>
Performs the conversion.
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 = ()
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.
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>
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>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn 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 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
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