Struct keynesis::noise::TransportSendHalf
source · [−]pub struct TransportSendHalf<H> where
H: Hash, { /* private fields */ }
Implementations
sourceimpl<H> TransportSendHalf<H> where
H: Hash,
impl<H> TransportSendHalf<H> where
H: Hash,
sourcepub fn noise_session(&self) -> &<H as Hash>::HASH
pub fn noise_session(&self) -> &<H as Hash>::HASH
unique identifier of the noise session
sourcepub fn remote_public_identity(&self) -> &PublicKey
pub fn remote_public_identity(&self) -> &PublicKey
get the remote’s public identity
sourcepub fn count_sent(&self) -> u64
pub fn count_sent(&self) -> u64
get the number of message sent to the remote peer
this function will be a little tainted by the handshake state it also account for the number of times either encrypt or decrypt has been used during the handshake. This is because during the handshake the exchange is symmetrical while in the transport era the exchanges are asymmetrical.
sourcepub fn send(
&mut self,
input: impl AsRef<[u8]>,
output: &mut [u8]
) -> Result<(), CipherStateError>
pub fn send(
&mut self,
input: impl AsRef<[u8]>,
output: &mut [u8]
) -> Result<(), CipherStateError>
send message to the remote peer
The output must be at least 16 bytes longer than the input this is in order to add the MAC, this will be use to authenticate the message has not been tempered with.
Auto Trait Implementations
impl<H> RefUnwindSafe for TransportSendHalf<H> where
<H as Hash>::HASH: RefUnwindSafe,
impl<H> Send for TransportSendHalf<H> where
<H as Hash>::HASH: Send,
impl<H> Sync for TransportSendHalf<H> where
<H as Hash>::HASH: Sync,
impl<H> Unpin for TransportSendHalf<H> where
<H as Hash>::HASH: Unpin,
impl<H> UnwindSafe for TransportSendHalf<H> where
<H as Hash>::HASH: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more