pub struct SliceCursor { /* private fields */ }Expand description
Drives a stage over bytes already in memory, without copying them.
Every input is a sub-slice carrying the total length. A sequential
request gets at least its minimum and up to window bytes (a small
window exercises boundaries); a range gets exactly its span.
Implementations§
Source§impl SliceCursor
impl SliceCursor
Sourcepub fn new(window: usize) -> Self
pub fn new(window: usize) -> Self
A cursor offering at most window bytes beyond each request’s
minimum (at least 1).
Sourcepub fn stats(&self) -> DriveStats
pub fn stats(&self) -> DriveStats
Steps, reads and bytes offered so far.
Sourcepub fn next<S: ByteStepper + ?Sized>(
&mut self,
bytes: &[u8],
stage: &mut S,
pulse: Option<&dyn Pulse>,
) -> Result<Yield<<S as ByteStepper>::Output>, DriveFailure<<S as ByteStepper>::Error, Infallible>>
pub fn next<S: ByteStepper + ?Sized>( &mut self, bytes: &[u8], stage: &mut S, pulse: Option<&dyn Pulse>, ) -> Result<Yield<<S as ByteStepper>::Output>, DriveFailure<<S as ByteStepper>::Error, Infallible>>
Step stage over bytes until it produces an output. Pass the same
bytes on every call.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SliceCursor
impl RefUnwindSafe for SliceCursor
impl Send for SliceCursor
impl Sync for SliceCursor
impl Unpin for SliceCursor
impl UnsafeUnpin for SliceCursor
impl UnwindSafe for SliceCursor
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