pub struct OwnedWriteable(/* private fields */);
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 AsHandleOrSocket for OwnedWriteable
impl AsHandleOrSocket for OwnedWriteable
OwnedWriteable
owns its handle.
Source§fn as_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>
fn as_handle_or_socket(&self) -> BorrowedHandleOrSocket<'_>
Like
AsHandle::as_handle
and AsSocket::as_socket
but can return either type.Source§impl Debug for OwnedWriteable
impl Debug for OwnedWriteable
Source§impl Drop for OwnedWriteable
impl Drop for OwnedWriteable
Source§impl From<OwnedHandle> for OwnedWriteable
impl From<OwnedHandle> for OwnedWriteable
OwnedWriteable
owns its handle.
Source§fn from(handle: OwnedHandle) -> Self
fn from(handle: OwnedHandle) -> Self
Converts to this type from the input type.
Source§impl From<OwnedHandleOrSocket> for OwnedWriteable
impl From<OwnedHandleOrSocket> for OwnedWriteable
OwnedWriteable
owns its handle.
Source§fn from(handle_or_socket: OwnedHandleOrSocket) -> Self
fn from(handle_or_socket: OwnedHandleOrSocket) -> Self
Converts to this type from the input type.
Source§impl From<OwnedWriteable> for OwnedHandleOrSocket
impl From<OwnedWriteable> for OwnedHandleOrSocket
OwnedWriteable
owns its handle.
Source§fn from(writeable: OwnedWriteable) -> Self
fn from(writeable: 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>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes 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 Freeze for OwnedWriteable
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> AsGrip for Twhere
T: AsHandleOrSocket,
impl<T> AsGrip for Twhere
T: AsHandleOrSocket,
Source§fn as_grip(&self) -> BorrowedHandleOrSocket<'_>
fn as_grip(&self) -> BorrowedHandleOrSocket<'_>
Extracts the grip.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FromFilelike for Twhere
T: From<OwnedHandle>,
impl<T> FromFilelike for Twhere
T: From<OwnedHandle>,
Source§fn from_filelike(owned: OwnedHandle) -> T
fn from_filelike(owned: OwnedHandle) -> 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> FromGrip for Twhere
T: From<OwnedHandleOrSocket>,
impl<T> FromGrip for Twhere
T: From<OwnedHandleOrSocket>,
Source§fn from_grip(owned_grip: OwnedHandleOrSocket) -> T
fn from_grip(owned_grip: OwnedHandleOrSocket) -> T
Consume an
OwnedGrip
and convert into a Self
.Source§impl<T> FromHandle for Twhere
T: From<OwnedHandle>,
impl<T> FromHandle for Twhere
T: From<OwnedHandle>,
Source§fn from_handle(owned_handle: OwnedHandle) -> T
fn from_handle(owned_handle: OwnedHandle) -> T
👎Deprecated since 1.0.0:
FromHandle::from_handle
is replaced by From<OwnedHandle>::from
Constructs a new instance of
Self
from the given handle. Read moreSource§fn from_into_handle<Owned>(into_owned: Owned) -> Self
fn from_into_handle<Owned>(into_owned: Owned) -> Self
Source§impl<T> IntoGrip for Twhere
T: Into<OwnedHandleOrSocket>,
impl<T> IntoGrip for Twhere
T: Into<OwnedHandleOrSocket>,
Source§fn into_grip(self) -> OwnedHandleOrSocket
fn into_grip(self) -> OwnedHandleOrSocket
Consume
self
and convert into an OwnedGrip
.