Struct futures_util::io::AllowStdIo [−][src]
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.
Implementations
impl<T> AllowStdIo<T>
[src][−]
pub fn new(io: T) -> Self
[src][−]
Creates a new AllowStdIo
from an existing IO object.
pub fn get_ref(&self) -> &T
[src][−]
Returns a reference to the contained IO object.
pub fn get_mut(&mut self) -> &mut T
[src][−]
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> AsyncBufRead for AllowStdIo<T> where
T: BufRead,
[src][+]
T: BufRead,
impl<T> AsyncRead for AllowStdIo<T> where
T: Read,
[src][+]
T: Read,
impl<T> AsyncSeek for AllowStdIo<T> where
T: Seek,
[src][+]
T: Seek,
impl<T> AsyncWrite for AllowStdIo<T> where
T: Write,
[src][+]
T: Write,
impl<T> BufRead for AllowStdIo<T> where
T: BufRead,
[src][+]
T: BufRead,
impl<T: Clone> Clone for AllowStdIo<T>
[src][+]
impl<T: Copy> Copy for AllowStdIo<T>
[src]
impl<T: Debug> Debug for AllowStdIo<T>
[src][+]
impl<T: Eq> Eq for AllowStdIo<T>
[src]
impl<T: Hash> Hash 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> Read for AllowStdIo<T> where
T: Read,
[src][+]
T: Read,
impl<T> Seek for AllowStdIo<T> where
T: Seek,
[src][+]
T: Seek,
impl<T> StructuralEq for AllowStdIo<T>
[src]
impl<T> StructuralPartialEq for AllowStdIo<T>
[src]
impl<T> Unpin for AllowStdIo<T>
[src]
impl<T> Write for AllowStdIo<T> where
T: Write,
[src][+]
T: Write,
Auto Trait Implementations
impl<T> RefUnwindSafe for AllowStdIo<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
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,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<R> AsyncBufReadExt for R where
R: AsyncBufRead + ?Sized,
[src][+]
R: AsyncBufRead + ?Sized,
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
[src][+]
R: AsyncRead + ?Sized,
impl<S> AsyncSeekExt for S where
S: AsyncSeek + ?Sized,
[src][+]
S: AsyncSeek + ?Sized,
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
[src][+]
W: AsyncWrite + ?Sized,
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> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
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>,