[−][src]Struct futures_util::io::AllowStdIo
A simple wrapper type which allows types which implement only
implement std::io::Read
or std::io::Write
to be used in contexts which expect an AsyncRead
or AsyncWrite
.
If these types issue an error with the kind io::ErrorKind::WouldBlock
,
it is expected that they will notify the current task on readiness.
Synchronous std
types should not issue errors of this kind and
are safe to use in this context. However, using these types with
AllowStdIo
will cause the event loop to block, so they should be used
with care.
Methods
impl<T> AllowStdIo<T>
[src][−]
pub fn new(io: T) -> Self
[src][−]
Creates a new AllowStdIo
from an existing IO object.
ⓘImportant traits for &'_ mut Fpub fn get_ref(&self) -> &T
[src][−]
ⓘImportant traits for &'_ mut F
Returns a reference to the contained IO object.
ⓘImportant traits for &'_ mut Fpub fn get_mut(&mut self) -> &mut T
[src][−]
ⓘImportant traits for &'_ mut F
Returns a mutable reference to the contained IO object.
pub fn into_inner(self) -> T
[src][−]
Consumes self and returns the contained IO object.
Trait Implementations
impl<T> Unpin for AllowStdIo<T>
[src]
impl<T: Clone> Clone for AllowStdIo<T>
[src][+]
impl<T: Copy> Copy for AllowStdIo<T>
[src]
impl<T: Eq> Eq for AllowStdIo<T>
[src]
impl<T: Ord> Ord for AllowStdIo<T>
[src][+]
impl<T: PartialEq> PartialEq<AllowStdIo<T>> for AllowStdIo<T>
[src][+]
impl<T: PartialOrd> PartialOrd<AllowStdIo<T>> for AllowStdIo<T>
[src][+]
impl<T: Debug> Debug for AllowStdIo<T>
[src][+]
impl<T: Hash> Hash for AllowStdIo<T>
[src][+]
impl<T> StructuralPartialEq for AllowStdIo<T>
[src]
impl<T> StructuralEq for AllowStdIo<T>
[src]
impl<T> Read for AllowStdIo<T> where
T: Read,
[src][+]
T: Read,
impl<T> Write for AllowStdIo<T> where
T: Write,
[src][+]
T: Write,
impl<T> BufRead for AllowStdIo<T> where
T: BufRead,
[src][+]
T: BufRead,
impl<T> Seek for AllowStdIo<T> where
T: Seek,
[src][+]
T: Seek,
impl<T> AsyncRead for AllowStdIo<T> where
T: Read,
[src][+]
T: Read,
impl<T> AsyncWrite for AllowStdIo<T> where
T: Write,
[src][+]
T: Write,
impl<T> AsyncSeek for AllowStdIo<T> where
T: Seek,
[src][+]
T: Seek,
impl<T> AsyncBufRead for AllowStdIo<T> where
T: BufRead,
[src][+]
T: BufRead,
Auto Trait Implementations
impl<T> Send for AllowStdIo<T> where
T: Send,
T: Send,
impl<T> Sync for AllowStdIo<T> where
T: Sync,
T: Sync,
impl<T> UnwindSafe for AllowStdIo<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for AllowStdIo<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
[src][+]
R: AsyncRead + ?Sized,
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
[src][+]
W: AsyncWrite + ?Sized,
impl<S> AsyncSeekExt for S where
S: AsyncSeek + ?Sized,
[src][+]
S: AsyncSeek + ?Sized,
impl<R> AsyncBufReadExt for R where
R: AsyncBufRead + ?Sized,
[src][+]
R: AsyncBufRead + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> From<T> for T
[src][+]
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,