pub struct ReadRequest<'a> { /* private fields */ }Expand description
Bytes a suspended task is waiting for.
Put the stream’s bytes from offset in
buffer: at least min_len of them, and up to
window_len if they are as easy to read. Fewer than
min_len is an unexpected end of the stream, and the task fails. Then resume the
task.
Implementations§
Source§impl ReadRequest<'_>
impl ReadRequest<'_>
Sourcepub fn window_len(&self) -> usize
pub fn window_len(&self) -> usize
How many bytes the task would like: at least min_len, and never past the
end of the stream.
Sourcepub fn buffer(&mut self) -> &mut Vec<u8> ⓘ
pub fn buffer(&mut self) -> &mut Vec<u8> ⓘ
The buffer to fill. It starts empty; put the bytes in it, replacing what it
holds. Its capacity is reused between requests. The request owns it, so a
request can be held across an .await, and the task is given the buffer
back when the request is dropped.
Trait Implementations§
Source§impl Debug for ReadRequest<'_>
impl Debug for ReadRequest<'_>
Source§impl Drop for ReadRequest<'_>
impl Drop for ReadRequest<'_>
Auto Trait Implementations§
impl<'a> !UnwindSafe for ReadRequest<'a>
impl<'a> Forget for ReadRequest<'a>
impl<'a> Freeze for ReadRequest<'a>
impl<'a> Move for ReadRequest<'a>
impl<'a> RefUnwindSafe for ReadRequest<'a>
impl<'a> Send for ReadRequest<'a>
impl<'a> Sync for ReadRequest<'a>
impl<'a> Unpin for ReadRequest<'a>
impl<'a> UnsafeUnpin for ReadRequest<'a>
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