[][src]Struct tox_packet::onion::OnionAnnounceResponse

pub struct OnionAnnounceResponse {
    pub sendback_data: u64,
    pub nonce: Nonce,
    pub payload: Vec<u8>,
}

It's used to respond to OnionAnnounceRequest packet.

sendback_data is the data from OnionAnnounceRequest that should be sent in the response as is. It's used in onion client to match onion response with sent request.

Serialized form:

LengthContent
10x84
8Data to send back in response
24Nonce
variablePayload

where payload is encrypted OnionAnnounceResponsePayload

Fields

sendback_data: u64

Data to send back in response

nonce: Nonce

Nonce for the current encrypted payload

payload: Vec<u8>

Encrypted payload

Implementations

impl OnionAnnounceResponse[src]

pub fn new(
    shared_secret: &PrecomputedKey,
    sendback_data: u64,
    payload: &OnionAnnounceResponsePayload
) -> OnionAnnounceResponse
[src]

Create new OnionAnnounceResponse object.

pub fn get_payload(
    &self,
    shared_secret: &PrecomputedKey
) -> Result<OnionAnnounceResponsePayload, GetPayloadError>
[src]

Decrypt payload and try to parse it as OnionAnnounceResponsePayload.

Returns Error in case of failure:

  • fails to decrypt
  • fails to parse as OnionAnnounceResponsePayload

Trait Implementations

impl Clone for OnionAnnounceResponse[src]

impl Debug for OnionAnnounceResponse[src]

impl Eq for OnionAnnounceResponse[src]

impl FromBytes for OnionAnnounceResponse[src]

impl PartialEq<OnionAnnounceResponse> for OnionAnnounceResponse[src]

impl StructuralEq for OnionAnnounceResponse[src]

impl StructuralPartialEq for OnionAnnounceResponse[src]

impl ToBytes for OnionAnnounceResponse[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.