[−][src]Struct tox_packet::onion::OnionAnnounceResponse
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:
Length | Content |
---|---|
1 | 0x84 |
8 | Data to send back in response |
24 | Nonce |
variable | Payload |
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]
shared_secret: &PrecomputedKey,
sendback_data: u64,
payload: &OnionAnnounceResponsePayload
) -> OnionAnnounceResponse
Create new OnionAnnounceResponse
object.
pub fn get_payload(
&self,
shared_secret: &PrecomputedKey
) -> Result<OnionAnnounceResponsePayload, GetPayloadError>
[src]
&self,
shared_secret: &PrecomputedKey
) -> Result<OnionAnnounceResponsePayload, GetPayloadError>
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]
fn clone(&self) -> OnionAnnounceResponse
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for OnionAnnounceResponse
[src]
impl Eq for OnionAnnounceResponse
[src]
impl FromBytes for OnionAnnounceResponse
[src]
impl PartialEq<OnionAnnounceResponse> for OnionAnnounceResponse
[src]
fn eq(&self, other: &OnionAnnounceResponse) -> bool
[src]
fn ne(&self, other: &OnionAnnounceResponse) -> bool
[src]
impl StructuralEq for OnionAnnounceResponse
[src]
impl StructuralPartialEq for OnionAnnounceResponse
[src]
impl ToBytes for OnionAnnounceResponse
[src]
Auto Trait Implementations
impl RefUnwindSafe for OnionAnnounceResponse
impl Send for OnionAnnounceResponse
impl Sync for OnionAnnounceResponse
impl Unpin for OnionAnnounceResponse
impl UnwindSafe for OnionAnnounceResponse
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,