Struct tari_comms_dht::envelope::DhtHeader[][src]

pub struct DhtHeader {
    pub version: u32,
    pub origin_mac: Vec<u8>,
    pub ephemeral_public_key: Vec<u8>,
    pub message_type: i32,
    pub network: i32,
    pub flags: u32,
    pub message_tag: u64,
    pub destination: Option<Destination>,
}

Fields

version: u32origin_mac: Vec<u8>

Origin public key of the message. This can be the same peer that sent the message or another peer if the message should be forwarded. This is optional but MUST be specified if the ENCRYPTED flag is set. If an ephemeral_public_key is specified, this MUST be encrypted using a derived ECDH shared key

ephemeral_public_key: Vec<u8>

Ephemeral public key component of the ECDH shared key. MUST be specified if the ENCRYPTED flag is set.

message_type: i32

The type of message

network: i32

The network for which this message is intended (e.g. TestNet, MainNet etc.)

flags: u32message_tag: u64

Message trace ID TODO: Remove for mainnet or when testing message traces is not required

destination: Option<Destination>

Implementations

impl DhtHeader[src]

pub fn message_type(&self) -> DhtMessageType[src]

Returns the enum value of message_type, or the default if the field is set to an invalid enum value.

pub fn set_message_type(&mut self, value: DhtMessageType)[src]

Sets message_type to the provided enum value.

pub fn network(&self) -> Network[src]

Returns the enum value of network, or the default if the field is set to an invalid enum value.

pub fn set_network(&mut self, value: Network)[src]

Sets network to the provided enum value.

Trait Implementations

impl Clone for DhtHeader[src]

impl Debug for DhtHeader[src]

impl Default for DhtHeader[src]

impl From<DhtMessageHeader> for DhtHeader[src]

impl Message for DhtHeader[src]

impl PartialEq<DhtHeader> for DhtHeader[src]

impl StructuralPartialEq for DhtHeader[src]

impl TryFrom<DhtHeader> for DhtMessageHeader[src]

type Error = DhtMessageError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync

impl<T> From<T> for T[src]

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

impl<T> IntoBody for T where
    T: Message
[src]

impl<T> IntoSql for T[src]

impl<T> MessageExt for T where
    T: Message
[src]

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,