Skip to main content

DhtMessage

Enum DhtMessage 

Source
pub enum DhtMessage {
    FindValue(FindValueRequest),
    FindValueResponse(FindValueResponse),
    Store(StoreRequest),
    StoreAck(StoreAck),
    BatchStore(BatchStoreRequest),
    BatchStoreAck(BatchStoreAck),
    FindNode(FindNodeRequest),
    FindNodeResponse(FindNodeResponse),
}
Expand description

Top-level protocol enum for cdn/dht/v1. Variant order matches ADR 022 §Message Types and is frozen per ADR 013.

⚠️ VARIANT ORDER FROZEN — ADR 013 §Protocol Enums Postcard encodes each variant as its declaration-order index. Reordering, inserting, or removing a variant is a wire-breaking change requiring an ALPN version bump (cdn/dht/v2). Discriminants are pinned by the dht_message_*_discriminant_is_* tests in this module — if you change this enum, those tests will fail and tell you why.

Variants§

§

FindValue(FindValueRequest)

discriminant 0 — asserted by dht_message_find_value_discriminant_is_zero

§

FindValueResponse(FindValueResponse)

discriminant 1 — asserted by dht_message_find_value_response_discriminant_is_one

§

Store(StoreRequest)

discriminant 2 — asserted by dht_message_store_discriminant_is_two

§

StoreAck(StoreAck)

discriminant 3 — asserted by dht_message_store_ack_discriminant_is_three

§

BatchStore(BatchStoreRequest)

discriminant 4 — asserted by dht_message_batch_store_discriminant_is_four. Batched publish; handled by decdn-node (see module docs).

§

BatchStoreAck(BatchStoreAck)

discriminant 5 — asserted by dht_message_batch_store_ack_discriminant_is_five. Per-hash ack for Self::BatchStore.

§

FindNode(FindNodeRequest)

discriminant 6 — asserted by dht_message_find_node_discriminant_is_six

§

FindNodeResponse(FindNodeResponse)

discriminant 7 — asserted by dht_message_find_node_response_discriminant_is_seven

Trait Implementations§

Source§

impl Clone for DhtMessage

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DhtMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DhtMessage

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for DhtMessage

Source§

impl PartialEq for DhtMessage

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DhtMessage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DhtMessage

Source§

impl TopLevelEnum for DhtMessage

Source§

const VARIANT_COUNT: u32 = 8

FindValue (0) … FindNodeResponse (7). Pinned by dht_message_variant_count_matches_discriminants.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.