Struct io_extras::owned::OwnedWriteable
source · [−]#[repr(transparent)]pub struct OwnedWriteable(_);
Expand description
An owning I/O handle that implements Write
.
This doesn’t implement Into*
or From*
traits.
Platform-specific behavior
On Posix-ish platforms, this writes to the handle as if it were a
[File
]. On Windows, this writes to a file-like handle as if it were a
[File
], and to a socket-like handle as if it were a TcpStream
.
Trait Implementations
sourceimpl AsFd for OwnedWriteable
impl AsFd for OwnedWriteable
OwnedWriteable
owns its handle.
sourcefn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
sourceimpl Debug for OwnedWriteable
impl Debug for OwnedWriteable
sourceimpl Drop for OwnedWriteable
impl Drop for OwnedWriteable
sourceimpl FromFd for OwnedWriteable
impl FromFd for OwnedWriteable
OwnedWriteable
owns its handle.
sourceimpl IntoFd for OwnedWriteable
impl IntoFd for OwnedWriteable
OwnedWriteable
owns its handle.
sourceimpl Write for OwnedWriteable
impl Write for OwnedWriteable
sourcefn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
sourcefn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
sourcefn write_all(&mut self, buf: &[u8]) -> Result<()>
fn write_all(&mut self, buf: &[u8]) -> Result<()>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations
impl RefUnwindSafe for OwnedWriteable
impl Send for OwnedWriteable
impl Sync for OwnedWriteable
impl Unpin for OwnedWriteable
impl UnwindSafe for OwnedWriteable
Blanket Implementations
sourceimpl<T> AsFilelike for T where
T: AsFd,
impl<T> AsFilelike for T where
T: AsFd,
sourcefn as_filelike(&self) -> BorrowedFd<'_>
fn as_filelike(&self) -> BorrowedFd<'_>
Borrows the reference. Read more
sourcefn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target> where
Target: FilelikeViewType,
fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target> where
Target: FilelikeViewType,
Return a borrowing view of a resource which dereferences to a &Target
. Read more
sourceimpl<T> AsGrip for T where
T: AsFd,
impl<T> AsGrip for T where
T: AsFd,
sourcefn as_grip(&self) -> BorrowedFd<'_>
fn as_grip(&self) -> BorrowedFd<'_>
Extracts the grip.
sourceimpl<T> AsSocketlike for T where
T: AsFd,
impl<T> AsSocketlike for T where
T: AsFd,
sourcefn as_socketlike(&self) -> BorrowedFd<'_>
fn as_socketlike(&self) -> BorrowedFd<'_>
Borrows the reference.
sourcefn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target> where
Target: SocketlikeViewType,
fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target> where
Target: SocketlikeViewType,
Return a borrowing view of a resource which dereferences to a &Target
. Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> FromFilelike for T where
T: FromFd,
impl<T> FromFilelike for T where
T: FromFd,
sourcefn from_filelike(owned: OwnedFd) -> T
fn from_filelike(owned: OwnedFd) -> T
Constructs a new instance of Self
from the given filelike object. Read more
sourcefn from_into_filelike<Owned>(owned: Owned) -> T where
Owned: IntoFilelike,
fn from_into_filelike<Owned>(owned: Owned) -> T where
Owned: IntoFilelike,
Constructs a new instance of Self
from the given filelike object
converted from into_owned
. Read more
sourceimpl<T> FromSocketlike for T where
T: FromFd,
impl<T> FromSocketlike for T where
T: FromFd,
sourcefn from_socketlike(owned: OwnedFd) -> T
fn from_socketlike(owned: OwnedFd) -> T
Constructs a new instance of Self
from the given socketlike object.
sourcefn from_into_socketlike<Owned>(owned: Owned) -> T where
Owned: IntoSocketlike,
fn from_into_socketlike<Owned>(owned: Owned) -> T where
Owned: IntoSocketlike,
Constructs a new instance of Self
from the given socketlike object
converted from into_owned
. Read more
sourceimpl<T> IntoFilelike for T where
T: IntoFd,
impl<T> IntoFilelike for T where
T: IntoFd,
sourcefn into_filelike(self) -> OwnedFd
fn into_filelike(self) -> OwnedFd
Consumes this object, returning the underlying filelike object. Read more
sourceimpl<T> IntoSocketlike for T where
T: IntoFd,
impl<T> IntoSocketlike for T where
T: IntoFd,
sourcefn into_socketlike(self) -> OwnedFd
fn into_socketlike(self) -> OwnedFd
Consumes this object, returning the underlying socketlike object.