Struct loco_protocol::secure::codec::SecureCodec
source · [−]pub struct SecureCodec<S> { /* private fields */ }Implementations
sourceimpl<S> SecureCodec<S>
impl<S> SecureCodec<S>
pub const fn new(crypto: CryptoStore, stream: S) -> Self
pub fn crypto(&self) -> &CryptoStore
pub fn stream(&self) -> &S
pub fn stream_mut(&mut self) -> &mut S
pub fn into_inner(self) -> (CryptoStore, S)
sourceimpl<S: Read> SecureCodec<S>
impl<S: Read> SecureCodec<S>
sourcepub fn read_packet(&mut self) -> Result<SecurePacket, SecureError>
pub fn read_packet(&mut self) -> Result<SecurePacket, SecureError>
Read one encrypted packet
sourceimpl<S: Write> SecureCodec<S>
impl<S: Write> SecureCodec<S>
sourcepub fn write_data(&mut self, buf: &[u8]) -> Result<usize, SecureError>
pub fn write_data(&mut self, buf: &[u8]) -> Result<usize, SecureError>
Write one secure packet. Returns size of packet written.
sourceimpl<S: AsyncRead + Unpin> SecureCodec<S>
impl<S: AsyncRead + Unpin> SecureCodec<S>
sourcepub async fn read_packet_async(&mut self) -> Result<SecurePacket, SecureError>
pub async fn read_packet_async(&mut self) -> Result<SecurePacket, SecureError>
Read one encrypted packet
sourceimpl<S: AsyncWrite + Unpin> SecureCodec<S>
impl<S: AsyncWrite + Unpin> SecureCodec<S>
sourcepub async fn write_data_async(
&mut self,
buf: &[u8]
) -> Result<usize, SecureError>
pub async fn write_data_async(
&mut self,
buf: &[u8]
) -> Result<usize, SecureError>
Write one secure packet. Returns size of packet written.
Trait Implementations
Auto Trait Implementations
impl<S> RefUnwindSafe for SecureCodec<S>where
S: RefUnwindSafe,
impl<S> Send for SecureCodec<S>where
S: Send,
impl<S> Sync for SecureCodec<S>where
S: Sync,
impl<S> Unpin for SecureCodec<S>where
S: Unpin,
impl<S> UnwindSafe for SecureCodec<S>where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more