pub struct ReadStreamToEnd { /* private fields */ }
Expand description
I/O-free coroutine to read bytes into a buffer until it reaches EOF.
Implementations§
Source§impl ReadStreamToEnd
impl ReadStreamToEnd
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new coroutine to read bytes using a buffer with
[Read::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 extend(&mut self, bytes: impl IntoIterator<Item = u8>)
pub fn extend(&mut self, bytes: impl IntoIterator<Item = u8>)
Extends the inner buffer with the given bytes slice.
Sourcepub fn resume(&mut self, arg: Option<StreamIo>) -> ReadStreamToEndResult
pub fn resume(&mut self, arg: Option<StreamIo>) -> ReadStreamToEndResult
Makes the coroutine progress.
Trait Implementations§
Source§impl Debug for ReadStreamToEnd
impl Debug for ReadStreamToEnd
Auto Trait Implementations§
impl Freeze for ReadStreamToEnd
impl RefUnwindSafe for ReadStreamToEnd
impl Send for ReadStreamToEnd
impl Sync for ReadStreamToEnd
impl Unpin for ReadStreamToEnd
impl UnwindSafe for ReadStreamToEnd
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