pub struct OwnedHandleOrSocket { /* private fields */ }
Expand description
HandleOrSocket
variant of io-lifetimes’
OwnedHandle
/OwnedSocket
.
Implementations§
Source§impl OwnedHandleOrSocket
impl OwnedHandleOrSocket
Sourcepub fn from_handle(handle: OwnedHandle) -> Self
pub fn from_handle(handle: OwnedHandle) -> Self
Construct a new OwnedHandleOrSocket
from an OwnedHandle
.
Sourcepub fn from_socket(socket: OwnedSocket) -> Self
pub fn from_socket(socket: OwnedSocket) -> Self
Construct a new OwnedHandleOrSocket
from an OwnedSocket
.
Sourcepub fn as_handle(&self) -> Option<BorrowedHandle<'_>>
pub fn as_handle(&self) -> Option<BorrowedHandle<'_>>
Like AsHandle::as_handle
, but returns an Option
so that
it can return None
if self
doesn’t contain a BorrowedHandle
.
Sourcepub fn as_socket(&self) -> Option<BorrowedSocket<'_>>
pub fn as_socket(&self) -> Option<BorrowedSocket<'_>>
Like AsSocket::as_socket
, but returns an Option
so that
it can return None
if self
doesn’t contain a BorrowedSocket
.
Trait Implementations§
Source§impl AsHandleOrSocket for OwnedHandleOrSocket
impl AsHandleOrSocket for OwnedHandleOrSocket
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 AsRawHandleOrSocket for OwnedHandleOrSocket
impl AsRawHandleOrSocket for OwnedHandleOrSocket
Source§fn as_raw_handle_or_socket(&self) -> RawHandleOrSocket
fn as_raw_handle_or_socket(&self) -> RawHandleOrSocket
Like
AsRawHandle::as_raw_handle
and AsRawSocket::as_raw_socket
but can return either type.Source§impl Debug for OwnedHandleOrSocket
impl Debug for OwnedHandleOrSocket
Source§impl Drop for OwnedHandleOrSocket
impl Drop for OwnedHandleOrSocket
Source§impl From<ChildStderr> for OwnedHandleOrSocket
impl From<ChildStderr> for OwnedHandleOrSocket
Source§fn from(stderr: ChildStderr) -> OwnedHandleOrSocket
fn from(stderr: ChildStderr) -> OwnedHandleOrSocket
Converts to this type from the input type.
Source§impl From<ChildStdin> for OwnedHandleOrSocket
impl From<ChildStdin> for OwnedHandleOrSocket
Source§fn from(stdin: ChildStdin) -> OwnedHandleOrSocket
fn from(stdin: ChildStdin) -> OwnedHandleOrSocket
Converts to this type from the input type.
Source§impl From<ChildStdout> for OwnedHandleOrSocket
impl From<ChildStdout> for OwnedHandleOrSocket
Source§fn from(stdout: ChildStdout) -> OwnedHandleOrSocket
fn from(stdout: ChildStdout) -> OwnedHandleOrSocket
Converts to this type from the input type.
Source§impl From<File> for OwnedHandleOrSocket
impl From<File> for OwnedHandleOrSocket
Source§fn from(file: File) -> OwnedHandleOrSocket
fn from(file: File) -> OwnedHandleOrSocket
Converts to this type from the input type.
Source§impl From<OwnedHandleOrSocket> for OwnedReadable
impl From<OwnedHandleOrSocket> for OwnedReadable
OwnedReadable
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<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<OwnedReadable> for OwnedHandleOrSocket
impl From<OwnedReadable> for OwnedHandleOrSocket
OwnedReadable
owns its handle.
Source§fn from(readable: OwnedReadable) -> Self
fn from(readable: OwnedReadable) -> 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 From<TcpListener> for OwnedHandleOrSocket
impl From<TcpListener> for OwnedHandleOrSocket
Source§fn from(listener: TcpListener) -> OwnedHandleOrSocket
fn from(listener: TcpListener) -> OwnedHandleOrSocket
Converts to this type from the input type.
Source§impl From<TcpStream> for OwnedHandleOrSocket
impl From<TcpStream> for OwnedHandleOrSocket
Source§fn from(stream: TcpStream) -> OwnedHandleOrSocket
fn from(stream: TcpStream) -> OwnedHandleOrSocket
Converts to this type from the input type.
Source§impl From<UdpSocket> for OwnedHandleOrSocket
impl From<UdpSocket> for OwnedHandleOrSocket
Source§fn from(socket: UdpSocket) -> OwnedHandleOrSocket
fn from(socket: UdpSocket) -> OwnedHandleOrSocket
Converts to this type from the input type.
Source§impl FromRawHandleOrSocket for OwnedHandleOrSocket
impl FromRawHandleOrSocket for OwnedHandleOrSocket
Source§unsafe fn from_raw_handle_or_socket(raw: RawHandleOrSocket) -> Self
unsafe fn from_raw_handle_or_socket(raw: RawHandleOrSocket) -> Self
Like
FromRawHandle::from_raw_handle
and
FromRawSocket::from_raw_socket
but can be passed either type. Read moreSource§impl IntoRawHandleOrSocket for OwnedHandleOrSocket
impl IntoRawHandleOrSocket for OwnedHandleOrSocket
Source§fn into_raw_handle_or_socket(self) -> RawHandleOrSocket
fn into_raw_handle_or_socket(self) -> RawHandleOrSocket
Like
IntoRawHandle::into_raw_handle
and
IntoRawSocket::into_raw_socket
but can return either type.Auto Trait Implementations§
impl Freeze for OwnedHandleOrSocket
impl RefUnwindSafe for OwnedHandleOrSocket
impl Send for OwnedHandleOrSocket
impl Sync for OwnedHandleOrSocket
impl Unpin for OwnedHandleOrSocket
impl UnwindSafe for OwnedHandleOrSocket
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> AsRawGrip for Twhere
T: AsRawHandleOrSocket,
impl<T> AsRawGrip for Twhere
T: AsRawHandleOrSocket,
Source§fn as_raw_grip(&self) -> RawHandleOrSocket
fn as_raw_grip(&self) -> RawHandleOrSocket
Extracts the raw 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> 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> FromRawGrip for Twhere
T: FromRawHandleOrSocket,
impl<T> FromRawGrip for Twhere
T: FromRawHandleOrSocket,
Source§unsafe fn from_raw_grip(raw_grip: RawHandleOrSocket) -> T
unsafe fn from_raw_grip(raw_grip: RawHandleOrSocket) -> T
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
.Source§impl<T> IntoRawGrip for Twhere
T: IntoRawHandleOrSocket,
impl<T> IntoRawGrip for Twhere
T: IntoRawHandleOrSocket,
Source§fn into_raw_grip(self) -> RawHandleOrSocket
fn into_raw_grip(self) -> RawHandleOrSocket
Consume
self
and convert into an RawGrip
.