Enum holochain_types::dht_op::DhtOp [−][src]
pub enum DhtOp {
StoreElement(Signature, Header, Option<Box<Entry>>),
StoreEntry(Signature, NewEntryHeader, Box<Entry>),
RegisterAgentActivity(Signature, Header),
RegisterUpdatedContent(Signature, Update, Option<Box<Entry>>),
RegisterUpdatedElement(Signature, Update, Option<Box<Entry>>),
RegisterDeletedBy(Signature, Delete),
RegisterDeletedEntryHeader(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
Used to notify the authority for a header that it has been created.
Conceptually, authorities receiving this DhtOp
do three things:
- Ensure that the element passes validation.
- Store the header 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, NewEntryHeader, 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 element passes validation.
- Store the entry into their DHT shard.
- Store the header into their CAS.
- Note: they do not become responsible for keeping the set of references from that header up-to-date.
- Add a “created-by” reference from the entry to the hash of the header.
TODO: document how those “created-by” references are stored in reality.
Tuple Fields of StoreEntry
Used to notify the authority for an agent’s public key that that agent has committed a new header.
Conceptually, authorities receiving this DhtOp
do three things:
- Ensure that the header alone passes surface-level validation.
- Store the header into their DHT shard.
- FIXME: @artbrock, do they?
- Add an “agent-activity” reference from the public key to the hash of the header.
TODO: document how those “agent-activity” references are stored in reality.
Op for updating an entry. This is sent to the entry authority.
Op for updating an element. This is sent to the element authority.
Op for registering a Header deletion with the Header authority
Op for registering a Header deletion with the Entry authority, so that the Entry can be marked Dead if all of its Headers have been deleted
RegisterAddLink(Signature, CreateLink)
Op for adding a link
Tuple Fields of RegisterAddLink
0: Signature
1: CreateLink
RegisterRemoveLink(Signature, DeleteLink)
Op for removing a link
Tuple Fields of RegisterRemoveLink
0: Signature
1: DeleteLink
Implementations
Mutable access to the Signature
Mutable access to the seq of the Header, if applicable
Returns the basis hash which determines which agents will receive this DhtOp
Convert a DhtOp to a DhtOpLight and basis
Extract inner Signature, Header and Option
Get the header from this op This requires cloning and converting the header as some ops don’t hold the Header type
pub fn from_type(
op_type: DhtOpType,
header: SignedHeader,
entry: Option<Entry>
) -> DhtOpResult<Self>
pub fn from_type(
op_type: DhtOpType,
header: SignedHeader,
entry: Option<Entry>
) -> DhtOpResult<Self>
From a type, header and an entry (if there is one)
Trait Implementations
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>,
Deserialize this value from the given Serde deserializer. Read more
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
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
Performs the conversion.
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
Performs the conversion.
type Error = SerializedBytesError
type Error = SerializedBytesError
The type returned in the event of a conversion error.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for DhtOp
impl UnwindSafe for DhtOp
Blanket Implementations
fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove Any::type_id_compat and use StdAny::type_id instead. https://github.com/rust-lang/rust/issues/27745 Read more
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
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>
impl<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>,
Move into a HoloHashed
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
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