[−][src]Struct kuska_handshake::BoxStreamRecv
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]
&mut self,
buf: &[u8],
dec: &mut [u8]
) -> Result<Decrypted<(usize, usize)>, Error>
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
impl RefUnwindSafe for BoxStreamRecv
impl Send for BoxStreamRecv
impl Sync for BoxStreamRecv
impl Unpin for BoxStreamRecv
impl UnwindSafe for BoxStreamRecv
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,
pub 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, 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.
pub 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>,