pub struct ReadCursor { /* private fields */ }Expand description
Drives a stage over a sequential stream.
The cursor owns one window over the stream. It reads read_size
bytes at a time (more when a request needs a larger contiguous span,
up to max_window), offers the window, and drops what the stage
took. Bytes the stage skips ahead over are read and discarded; a
request behind the stream position is
PumpFailure::NeedsRandomAccess.
Implementations§
Source§impl ReadCursor
impl ReadCursor
Sourcepub fn new(read_size: usize, max_window: usize) -> Self
pub fn new(read_size: usize, max_window: usize) -> Self
A cursor reading read_size bytes at a time (at least 512) and
holding at most max_window contiguous bytes for one request.
Sourcepub fn retained_input_capacity(&self) -> usize
pub fn retained_input_capacity(&self) -> usize
Retained input allocation capacity, excluding the reader’s own buffers.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReadCursor
impl RefUnwindSafe for ReadCursor
impl Send for ReadCursor
impl Sync for ReadCursor
impl Unpin for ReadCursor
impl UnsafeUnpin for ReadCursor
impl UnwindSafe for ReadCursor
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