pub struct FrameReader<R, const N: usize> { /* private fields */ }Expand description
Reads frames of exactly N bytes from an AsyncRead.
A partially read frame is kept inside, so unlike AsyncReadExt::read_exact
reading a frame can be cancelled and resumed.
Implementations§
Source§impl<R: AsyncRead, const N: usize> FrameReader<R, N>
impl<R: AsyncRead, const N: usize> FrameReader<R, N>
Sourcepub async fn read_exact<E: 'static, const EVENTS: usize, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize>(
&mut self,
ctx: &Context<'_, E, EVENTS, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>,
) -> Result<Option<[u8; N]>, FrameReaderError<R::Error>>
pub async fn read_exact<E: 'static, const EVENTS: usize, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize>( &mut self, ctx: &Context<'_, E, EVENTS, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>, ) -> Result<Option<[u8; N]>, FrameReaderError<R::Error>>
Auto Trait Implementations§
impl<R, const N: usize> Forget for FrameReader<R, N>
impl<R, const N: usize> Freeze for FrameReader<R, N>
impl<R, const N: usize> Move for FrameReader<R, N>
impl<R, const N: usize> RefUnwindSafe for FrameReader<R, N>
impl<R, const N: usize> Send for FrameReader<R, N>
impl<R, const N: usize> Sync for FrameReader<R, N>
impl<R, const N: usize> Unpin for FrameReader<R, N>
impl<R, const N: usize> UnsafeUnpin for FrameReader<R, N>
impl<R, const N: usize> UnwindSafe for FrameReader<R, N>
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