pub struct Reader {
pub inner: Mode,
pub op: Op,
}Fields§
§inner: Mode§op: OpImplementations§
Source§impl Reader
impl Reader
pub fn new(inner: impl Into<Mode>) -> Self
pub fn with_buf( inner: ReadableStreamByobReader, internal_buf: ArrayBuffer, ) -> Self
Sourcepub async fn read_into(&mut self, buf: &mut [u8]) -> Result<usize, ReadError>
pub async fn read_into(&mut self, buf: &mut [u8]) -> Result<usize, ReadError>
Read from the stream into the given buffer, returning the number of bytes read.
Returns Ok(0) when the stream is closed and has no more data.
Consumes the leftovers of the chunks that did not fit into the buffers
of the previous reads, and resolves the reads left pending by
a dropped tokio::io::AsyncRead::poll_read.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Reader
impl !Send for Reader
impl !Sync for Reader
impl Freeze for Reader
impl Unpin for Reader
impl UnsafeUnpin for Reader
impl UnwindSafe for Reader
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