pub struct Adapter<T> { /* private fields */ }
Expand description
Adapter to implement AsyncReadAt + AsyncGetSize for AsyncRead + AsyncSeek.
Implementations§
Trait Implementations§
Source§impl<T: AsyncSeek + Unpin> AsyncGetSize for Adapter<T>
impl<T: AsyncSeek + Unpin> AsyncGetSize for Adapter<T>
Source§impl<T: AsyncRead + AsyncSeek + Unpin> AsyncReadAt for Adapter<T>
impl<T: AsyncRead + AsyncSeek + Unpin> AsyncReadAt for Adapter<T>
Source§fn poll_read_at(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
offset: u64,
buf: &mut [u8],
) -> Poll<Result<usize>>
fn poll_read_at( self: Pin<&mut Self>, cx: &mut Context<'_>, offset: u64, buf: &mut [u8], ) -> Poll<Result<usize>>
Attempt to read at most
buf.len()
bytes starting at offset
into buf
. On success
returns the number of bytes read.
Contents of buf
are only altered on success.
Reads of more than zero but fewer than buf.len()
bytes do NOT indicate EOF.
Reads of zero bytes only occur if buf.len() == 0
or EOF.Auto Trait Implementations§
impl<T> Freeze for Adapter<T>where
T: Freeze,
impl<T> RefUnwindSafe for Adapter<T>where
T: RefUnwindSafe,
impl<T> Send for Adapter<T>where
T: Send,
impl<T> Sync for Adapter<T>where
T: Sync,
impl<T> Unpin for Adapter<T>where
T: Unpin,
impl<T> UnwindSafe for Adapter<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> AsyncGetSizeExt for Twhere
T: AsyncGetSize + ?Sized,
impl<T> AsyncGetSizeExt for Twhere
T: AsyncGetSize + ?Sized,
Source§impl<T> AsyncReadAtExt for Twhere
T: AsyncReadAt + ?Sized,
impl<T> AsyncReadAtExt for Twhere
T: AsyncReadAt + ?Sized,
Source§fn read_at<'a>(&'a mut self, offset: u64, buf: &'a mut [u8]) -> ReadAt<'a, Self>where
Self: Unpin,
fn read_at<'a>(&'a mut self, offset: u64, buf: &'a mut [u8]) -> ReadAt<'a, Self>where
Self: Unpin,
Returns a future that reads at
offset
, and fill buf
, on success the number of bytes
read is returned.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