pub enum DhtOp {
    StoreRecord(SignatureActionOption<Box<Entry>>),
    StoreEntry(SignatureNewEntryActionBox<Entry>),
    RegisterAgentActivity(SignatureAction),
    RegisterUpdatedContent(SignatureUpdateOption<Box<Entry>>),
    RegisterUpdatedRecord(SignatureUpdateOption<Box<Entry>>),
    RegisterDeletedBy(SignatureDelete),
    RegisterDeletedEntryAction(SignatureDelete),
    RegisterAddLink(SignatureCreateLink),
    RegisterRemoveLink(SignatureDeleteLink),
}
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(SignatureActionOption<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(SignatureNewEntryActionBox<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(SignatureAction)

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(SignatureUpdateOption<Box<Entry>>)

Op for updating an entry. This is sent to the entry authority.

RegisterUpdatedRecord(SignatureUpdateOption<Box<Entry>>)

Op for updating a record. This is sent to the record authority.

RegisterDeletedBy(SignatureDelete)

Op for registering an action deletion with the Action authority

RegisterDeletedEntryAction(SignatureDelete)

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

Op for adding a link

Op for removing a link

Implementations

Mutable access to the Author

Access to the Timestamp

Mutable access to the Timestamp

Mutable access to the Signature

Mutable access to the seq of the Action, if applicable

source

pub fn action_entry_data_mut(
    &mut self
) -> Option<(&mut EntryHash, &mut EntryType)>

Mutable access to the entry data of the Action, if applicable

Returns the basis hash which determines which agents will receive this DhtOp

Convert a DhtOp to a DhtOpLight and basis

Get the signature for this op

Extract inner Signature, Action and Option from an op

Get the action from this op This requires cloning and converting the action as some ops don’t hold the Action type

Get the entry from this op, if one exists

Get the type as a unit enum, for Display purposes

From a type, action and an entry (if there is one)

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

Generate an arbitrary value of Self from the given unstructured data. Read more
Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
The HashType which this content will be hashed to
The HashType which this content will be hashed to
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
The op’s Location
The op’s Timestamp
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
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
The quantized space and time coordinates, based on the location and timestamp.
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Serialize this value into the given Serde serializer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Deserializes using the given deserializer
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
Construct a HoloHash from a reference
Move into a HoloHashed
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type for metadata in pointers and references to Self.
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more