[][src]Struct tox_packet::relay::OnionRequest

pub struct OnionRequest {
    pub nonce: Nonce,
    pub ip_port: IpPort,
    pub temporary_pk: PublicKey,
    pub payload: Vec<u8>,
}

Sent by client to server. The server will pack payload from this request to OnionRequest1 packet and send it to UDP socket. The server can accept both TCP and UDP families as destination IP address but regardless of this it will always send OnionRequest1 to UDP socket. Return address from OnionRequest1 will contain TCP address so that when we get OnionResponse2 we will know that this response should be sent to TCP client connected to our server.

Serialized form:

LengthContent
10x08
24Nonce
1IpType
4 or 16IPv4 or IPv6 address
0 or 12Padding for IPv4
2Port
32PublicKey
variablePayload

Fields

nonce: Nonce

Nonce that was used for payload encryption

ip_port: IpPort

Address of the next onion node

temporary_pk: PublicKey

Temporary PublicKey for the current encrypted payload

payload: Vec<u8>

Encrypted payload

Trait Implementations

impl Clone for OnionRequest[src]

impl Debug for OnionRequest[src]

impl FromBytes for OnionRequest[src]

impl PartialEq<OnionRequest> for OnionRequest[src]

impl StructuralPartialEq for OnionRequest[src]

impl ToBytes for OnionRequest[src]

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> From<T> for T[src]

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

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.