pub struct ReadStream { /* private fields */ }
Expand description
I/O-free coroutine to read bytes into a buffer.
Implementations§
Source§impl ReadStream
impl ReadStream
Sourcepub const DEFAULT_CAPACITY: usize = 8_192usize
pub const DEFAULT_CAPACITY: usize = 8_192usize
The default read buffer capacity.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new coroutine to read bytes using a buffer with
Self::DEFAULT_CAPACITY
capacity.
See Self::with_capacity
for a custom buffer capacity.
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new coroutine to read bytes using a buffer with the given capacity.
Sourcepub fn resume(&mut self, arg: Option<StreamIo>) -> ReadStreamResult
pub fn resume(&mut self, arg: Option<StreamIo>) -> ReadStreamResult
Makes the read progress.
Trait Implementations§
Source§impl Debug for ReadStream
impl Debug for ReadStream
Auto Trait Implementations§
impl Freeze for ReadStream
impl RefUnwindSafe for ReadStream
impl Send for ReadStream
impl Sync for ReadStream
impl Unpin for ReadStream
impl UnwindSafe for ReadStream
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