pub struct ReadToEnd { /* private fields */ }
Expand description
I/O-free coroutine for reading bytes into a buffer until it reaches EOF.
Implementations§
Source§impl ReadToEnd
impl ReadToEnd
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>)
Adds the given bytes the to inner buffer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReadToEnd
impl RefUnwindSafe for ReadToEnd
impl Send for ReadToEnd
impl Sync for ReadToEnd
impl Unpin for ReadToEnd
impl UnwindSafe for ReadToEnd
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