pub struct OwnedHandleOrSocket { /* private fields */ }
Expand description

HandleOrSocket variant of io-lifetimes’ OwnedHandle/OwnedSocket.

Implementations§

source§

impl OwnedHandleOrSocket

source

pub fn from_handle(handle: OwnedHandle) -> Self

Construct a new OwnedHandleOrSocket from an OwnedHandle.

source

pub fn from_socket(socket: OwnedSocket) -> Self

Construct a new OwnedHandleOrSocket from an OwnedSocket.

source

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.

source

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

source§

impl AsRawHandleOrSocket for OwnedHandleOrSocket

source§

impl Debug for OwnedHandleOrSocket

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for OwnedHandleOrSocket

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<ChildStderr> for OwnedHandleOrSocket

source§

fn from(stderr: ChildStderr) -> OwnedHandleOrSocket

Converts to this type from the input type.
source§

impl From<ChildStdin> for OwnedHandleOrSocket

source§

fn from(stdin: ChildStdin) -> OwnedHandleOrSocket

Converts to this type from the input type.
source§

impl From<ChildStdout> for OwnedHandleOrSocket

source§

fn from(stdout: ChildStdout) -> OwnedHandleOrSocket

Converts to this type from the input type.
source§

impl From<File> for OwnedHandleOrSocket

source§

fn from(file: File) -> OwnedHandleOrSocket

Converts to this type from the input type.
source§

impl From<OwnedHandleOrSocket> for OwnedReadable

OwnedReadable owns its handle.

source§

fn from(handle_or_socket: OwnedHandleOrSocket) -> Self

Converts to this type from the input type.
source§

impl From<OwnedHandleOrSocket> for OwnedWriteable

OwnedWriteable owns its handle.

source§

fn from(handle_or_socket: OwnedHandleOrSocket) -> Self

Converts to this type from the input type.
source§

impl From<OwnedReadable> for OwnedHandleOrSocket

OwnedReadable owns its handle.

source§

fn from(readable: OwnedReadable) -> Self

Converts to this type from the input type.
source§

impl From<OwnedWriteable> for OwnedHandleOrSocket

OwnedWriteable owns its handle.

source§

fn from(writeable: OwnedWriteable) -> Self

Converts to this type from the input type.
source§

impl From<TcpListener> for OwnedHandleOrSocket

source§

fn from(listener: TcpListener) -> OwnedHandleOrSocket

Converts to this type from the input type.
source§

impl From<TcpStream> for OwnedHandleOrSocket

source§

fn from(stream: TcpStream) -> OwnedHandleOrSocket

Converts to this type from the input type.
source§

impl From<UdpSocket> for OwnedHandleOrSocket

source§

fn from(socket: UdpSocket) -> OwnedHandleOrSocket

Converts to this type from the input type.
source§

impl FromRawHandleOrSocket for OwnedHandleOrSocket

source§

impl IntoRawHandleOrSocket for OwnedHandleOrSocket

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsGrip for T

source§

fn as_grip(&self) -> BorrowedHandleOrSocket<'_>

Extracts the grip.
source§

impl<T> AsRawGrip for T

source§

fn as_raw_grip(&self) -> RawHandleOrSocket

Extracts the raw grip.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGrip for T

source§

fn from_grip(owned_grip: OwnedHandleOrSocket) -> T

Consume an OwnedGrip and convert into a Self.
source§

impl<T> FromRawGrip for T

source§

unsafe fn from_raw_grip(raw_grip: RawHandleOrSocket) -> T

Consume an RawGrip and convert into a Self. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoGrip for T

source§

fn into_grip(self) -> OwnedHandleOrSocket

Consume self and convert into an OwnedGrip.
source§

impl<T> IntoRawGrip for T

source§

fn into_raw_grip(self) -> RawHandleOrSocket

Consume self and convert into an RawGrip.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.