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§
source§impl AsFd for OwnedWriteable
impl AsFd for OwnedWriteable
OwnedWriteable
owns its handle.
source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
source§impl Debug for OwnedWriteable
impl Debug for OwnedWriteable
source§impl Drop for OwnedWriteable
impl Drop for OwnedWriteable
source§impl From<OwnedFd> for OwnedWriteable
impl From<OwnedFd> for OwnedWriteable
OwnedWriteable
owns its handle.
source§impl From<OwnedWriteable> for OwnedFd
impl From<OwnedWriteable> for OwnedFd
OwnedWriteable
owns its handle.
source§fn from(owned: OwnedWriteable) -> Self
fn from(owned: OwnedWriteable) -> Self
Converts to this type from the input type.
source§impl Write for OwnedWriteable
impl Write for OwnedWriteable
source§fn 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
source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)source§fn 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
source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
🔬This is a nightly-only experimental API. (
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§
source§impl<T> AsFilelike for Twhere
T: AsFd,
impl<T> AsFilelike for Twhere T: AsFd,
source§fn as_filelike(&self) -> BorrowedFd<'_>
fn as_filelike(&self) -> BorrowedFd<'_>
Borrows the reference. Read more
source§fn 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 moresource§impl<T> AsGrip for Twhere
T: AsFd,
impl<T> AsGrip for Twhere T: AsFd,
source§fn as_grip(&self) -> BorrowedFd<'_>
fn as_grip(&self) -> BorrowedFd<'_>
Extracts the grip.
source§impl<T> AsSocketlike for Twhere
T: AsFd,
impl<T> AsSocketlike for Twhere T: AsFd,
source§fn as_socketlike(&self) -> BorrowedFd<'_>
fn as_socketlike(&self) -> BorrowedFd<'_>
Borrows the reference.
source§fn 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 moresource§impl<T> FromFd for Twhere
T: From<OwnedFd>,
impl<T> FromFd for Twhere T: From<OwnedFd>,
source§impl<T> FromFilelike for Twhere
T: From<OwnedFd>,
impl<T> FromFilelike for Twhere T: From<OwnedFd>,
source§fn from_filelike(owned: OwnedFd) -> T
fn from_filelike(owned: OwnedFd) -> T
Constructs a new instance of
Self
from the given filelike object. Read moresource§fn from_into_filelike<Owned>(owned: Owned) -> Twhere
Owned: IntoFilelike,
fn from_into_filelike<Owned>(owned: Owned) -> Twhere Owned: IntoFilelike,
Constructs a new instance of
Self
from the given filelike object
converted from into_owned
. Read moresource§impl<T> FromSocketlike for Twhere
T: From<OwnedFd>,
impl<T> FromSocketlike for Twhere T: From<OwnedFd>,
source§fn from_socketlike(owned: OwnedFd) -> T
fn from_socketlike(owned: OwnedFd) -> T
Constructs a new instance of
Self
from the given socketlike object.source§fn from_into_socketlike<Owned>(owned: Owned) -> Twhere
Owned: IntoSocketlike,
fn from_into_socketlike<Owned>(owned: Owned) -> Twhere Owned: IntoSocketlike,
Constructs a new instance of
Self
from the given socketlike object
converted from into_owned
.source§impl<T> IntoFilelike for Twhere
T: Into<OwnedFd>,
impl<T> IntoFilelike for Twhere T: Into<OwnedFd>,
source§fn into_filelike(self) -> OwnedFd
fn into_filelike(self) -> OwnedFd
Consumes this object, returning the underlying filelike object. Read more
source§impl<T> IntoSocketlike for Twhere
T: Into<OwnedFd>,
impl<T> IntoSocketlike for Twhere T: Into<OwnedFd>,
source§fn into_socketlike(self) -> OwnedFd
fn into_socketlike(self) -> OwnedFd
Consumes this object, returning the underlying socketlike object.