[][src]Struct kuska_handshake::BoxStreamRecv

pub struct BoxStreamRecv { /* fields omitted */ }

The transport agnostic boxstream receiving side.

Implementations

impl BoxStreamRecv[src]

pub fn new(key_nonce: KeyNonce) -> Self[src]

Create a new BoxStreamRecv from the key_nonce.

pub fn decrypt(
    &mut self,
    buf: &[u8],
    dec: &mut [u8]
) -> Result<Decrypted<(usize, usize)>, Error>
[src]

Decrypt a single boxstream message every two calls (one to decrypt and parse the header, the other do decrypt the body) by decrypting from buf and writting the plaintex into dec. Returns the number of bytes read from buf and the number of bytes written into dec. If a goodbye message is received, an Err(Error::Goodbye) will be returned and the following calls will return Ok((0, 0)).

pub fn recv_bytes(&self) -> usize[src]

Returns the number of received bytes needed for the next decrypt call.

pub fn goodbye_recvd(&self) -> bool[src]

Returns whether the goodbye message has been received or not.

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, 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.