Struct embedded_io::adapters::FromTokio
source · [−]pub struct FromTokio<T: ?Sized> { /* private fields */ }
Available on crate feature
tokio
only.Expand description
Adapter from tokio::io
traits.
Implementations
sourceimpl<T> FromTokio<T>
impl<T> FromTokio<T>
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume the adapter, returning the inner object.
Trait Implementations
sourceimpl<T: AsyncRead + Unpin + ?Sized> Read for FromTokio<T>
impl<T: AsyncRead + Unpin + ?Sized> Read for FromTokio<T>
type ReadFuture<'a>
where
Self: 'a = impl Future<Output = Result<usize, <FromTokio<T> as Io>::Error>> + 'a
type ReadFuture<'a>
where
Self: 'a = impl Future<Output = Result<usize, <FromTokio<T> as Io>::Error>> + 'a
Available on crate feature
async
only.Future returned by
read
.sourcefn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a>
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a>
Available on crate feature
async
only.Pull some bytes from this source into the specified buffer, returning how many bytes were read.
sourcefn read_exact<'a>(
&'a mut self,
buf: &'a mut [u8]
) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>> + 'a
fn read_exact<'a>(
&'a mut self,
buf: &'a mut [u8]
) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>> + 'a
Available on crate feature
async
only.Read the exact number of bytes required to fill
buf
.sourceimpl<T: AsyncSeek + Unpin + ?Sized> Seek for FromTokio<T>
impl<T: AsyncSeek + Unpin + ?Sized> Seek for FromTokio<T>
type SeekFuture<'a>
where
Self: 'a = impl Future<Output = Result<u64, <FromTokio<T> as Io>::Error>> + 'a
type SeekFuture<'a>
where
Self: 'a = impl Future<Output = Result<u64, <FromTokio<T> as Io>::Error>> + 'a
Available on crate feature
async
only.Future returned by
seek
.sourcefn seek<'a>(&'a mut self, pos: SeekFrom) -> Self::SeekFuture<'a>
fn seek<'a>(&'a mut self, pos: SeekFrom) -> Self::SeekFuture<'a>
Available on crate feature
async
only.Seek to an offset, in bytes, in a stream.
sourcefn rewind<'a>(
&'a mut self
) -> impl Future<Output = Result<(), Self::Error>> + 'a
fn rewind<'a>(
&'a mut self
) -> impl Future<Output = Result<(), Self::Error>> + 'a
Available on crate feature
async
only.Rewind to the beginning of a stream.
sourcefn stream_position<'a>(&'a mut self) -> Self::SeekFuture<'a>
fn stream_position<'a>(&'a mut self) -> Self::SeekFuture<'a>
Available on crate feature
async
only.Returns the current seek position from the start of the stream.
sourceimpl<T: AsyncWrite + Unpin + ?Sized> Write for FromTokio<T>
impl<T: AsyncWrite + Unpin + ?Sized> Write for FromTokio<T>
type WriteFuture<'a>
where
Self: 'a = impl Future<Output = Result<usize, <FromTokio<T> as Io>::Error>> + 'a
type WriteFuture<'a>
where
Self: 'a = impl Future<Output = Result<usize, <FromTokio<T> as Io>::Error>> + 'a
Available on crate feature
async
only.Future returned by
write
.type FlushFuture<'a>
where
Self: 'a = impl Future<Output = Result<(), <FromTokio<T> as Io>::Error>> + 'a
type FlushFuture<'a>
where
Self: 'a = impl Future<Output = Result<(), <FromTokio<T> as Io>::Error>> + 'a
Available on crate feature
async
only.Future returned by
flush
.sourcefn write<'a>(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture<'a>
fn write<'a>(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture<'a>
Available on crate feature
async
only.Write a buffer into this writer, returning how many bytes were written.
sourcefn flush<'a>(&'a mut self) -> Self::FlushFuture<'a>
fn flush<'a>(&'a mut self) -> Self::FlushFuture<'a>
Available on crate feature
async
only.Flush this output stream, ensuring that all intermediately buffered contents reach their destination.
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for FromTokio<T>where
T: RefUnwindSafe,
impl<T: ?Sized> Send for FromTokio<T>where
T: Send,
impl<T: ?Sized> Sync for FromTokio<T>where
T: Sync,
impl<T: ?Sized> Unpin for FromTokio<T>where
T: Unpin,
impl<T: ?Sized> UnwindSafe for FromTokio<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more