pub struct FrameReader { /* private fields */ }Expand description
Zero-copy frame reader — reads and decrypts from TCP stream
Implementations§
Source§impl FrameReader
impl FrameReader
pub fn new() -> Self
Sourcepub async fn read_frame(
&mut self,
stream: &mut TcpStream,
session: &CryptoSession,
) -> Result<Vec<u8>, FrameError>
pub async fn read_frame( &mut self, stream: &mut TcpStream, session: &CryptoSession, ) -> Result<Vec<u8>, FrameError>
Read a single frame: reads [len:4], then reads [encrypted_payload], decrypts in-place.
Returns decrypted plaintext as Vec<u8>.
Source§impl FrameReader
impl FrameReader
pub async fn read_frame_padded( &mut self, stream: &mut TcpStream, session: &CryptoSession, ) -> Result<Vec<u8>, FrameError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FrameReader
impl RefUnwindSafe for FrameReader
impl Send for FrameReader
impl Sync for FrameReader
impl Unpin for FrameReader
impl UnsafeUnpin for FrameReader
impl UnwindSafe for FrameReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more