Struct io_lifetimes::OwnedFd
1.63.0 · source · pub struct OwnedFd { /* private fields */ }
Expand description
An owned file descriptor.
This closes the file descriptor on drop. It is guaranteed that nobody else will close the file descriptor.
This uses repr(transparent)
and has the representation of a host file
descriptor, so it can be used in FFI in places where a file descriptor is
passed as a consumed argument or returned as an owned value, and it never
has the value -1
.
You can use AsFd::as_fd
to obtain a BorrowedFd
.
Implementations§
Trait Implementations§
1.63.0 · source§impl AsFd for OwnedFd
impl AsFd for OwnedFd
source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
1.63.0 · source§impl From<ChildStderr> for OwnedFd
impl From<ChildStderr> for OwnedFd
source§fn from(child_stderr: ChildStderr) -> OwnedFd
fn from(child_stderr: ChildStderr) -> OwnedFd
Takes ownership of a ChildStderr
’s file descriptor.
1.63.0 · source§impl From<ChildStdin> for OwnedFd
impl From<ChildStdin> for OwnedFd
source§fn from(child_stdin: ChildStdin) -> OwnedFd
fn from(child_stdin: ChildStdin) -> OwnedFd
Takes ownership of a ChildStdin
’s file descriptor.
1.63.0 · source§impl From<ChildStdout> for OwnedFd
impl From<ChildStdout> for OwnedFd
source§fn from(child_stdout: ChildStdout) -> OwnedFd
fn from(child_stdout: ChildStdout) -> OwnedFd
Takes ownership of a ChildStdout
’s file descriptor.
source§impl From<PipeReader> for OwnedFd
impl From<PipeReader> for OwnedFd
source§fn from(pipe: PipeReader) -> OwnedFd
fn from(pipe: PipeReader) -> OwnedFd
source§impl From<PipeWriter> for OwnedFd
impl From<PipeWriter> for OwnedFd
source§fn from(pipe: PipeWriter) -> OwnedFd
fn from(pipe: PipeWriter) -> OwnedFd
1.63.0 · source§impl From<TcpListener> for OwnedFd
impl From<TcpListener> for OwnedFd
source§fn from(tcp_listener: TcpListener) -> OwnedFd
fn from(tcp_listener: TcpListener) -> OwnedFd
Takes ownership of a TcpListener
’s socket file descriptor.
1.63.0 · source§impl From<UnixDatagram> for OwnedFd
impl From<UnixDatagram> for OwnedFd
source§fn from(unix_datagram: UnixDatagram) -> OwnedFd
fn from(unix_datagram: UnixDatagram) -> OwnedFd
Takes ownership of a UnixDatagram
’s socket file descriptor.
1.63.0 · source§impl From<UnixListener> for OwnedFd
impl From<UnixListener> for OwnedFd
source§fn from(listener: UnixListener) -> OwnedFd
fn from(listener: UnixListener) -> OwnedFd
Takes ownership of a UnixListener
’s socket file descriptor.
1.63.0 · source§impl From<UnixStream> for OwnedFd
impl From<UnixStream> for OwnedFd
source§fn from(unix_stream: UnixStream) -> OwnedFd
fn from(unix_stream: UnixStream) -> OwnedFd
Takes ownership of a UnixStream
’s socket file descriptor.
1.63.0 · source§impl IntoRawFd for OwnedFd
impl IntoRawFd for OwnedFd
source§fn into_raw_fd(self) -> i32
fn into_raw_fd(self) -> i32
1.70.0 · source§impl IsTerminal for OwnedFd
impl IsTerminal for OwnedFd
source§fn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
true
if the descriptor/handle refers to a terminal/tty. Read moreimpl FilelikeViewType for OwnedFd
Auto Trait Implementations§
impl Freeze for OwnedFd
impl RefUnwindSafe for OwnedFd
impl Send for OwnedFd
impl Sync for OwnedFd
impl Unpin for OwnedFd
impl UnwindSafe for OwnedFd
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<'_>
source§fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target>where
Target: FilelikeViewType,
fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target>where
Target: FilelikeViewType,
&Target
. Read moresource§impl<T> AsRawFilelike for Twhere
T: AsRawFd,
impl<T> AsRawFilelike for Twhere
T: AsRawFd,
source§fn as_raw_filelike(&self) -> i32
fn as_raw_filelike(&self) -> i32
source§impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
impl<T> AsRawSocketlike for Twhere
T: AsRawFd,
source§fn as_raw_socketlike(&self) -> i32
fn as_raw_socketlike(&self) -> i32
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<'_>
source§fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
&Target
. Read moresource§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
source§impl<T> FromFd for T
impl<T> FromFd for T
source§impl<T> FromFilelike for T
impl<T> FromFilelike for T
source§fn from_filelike(owned: OwnedFd) -> T
fn from_filelike(owned: OwnedFd) -> T
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,
Self
from the given filelike object
converted from into_owned
. Read moresource§impl<T> FromRawFilelike for Twhere
T: FromRawFd,
impl<T> FromRawFilelike for Twhere
T: FromRawFd,
source§unsafe fn from_raw_filelike(raw: i32) -> T
unsafe fn from_raw_filelike(raw: i32) -> T
Self
from the raw value. Read moresource§impl<T> FromRawSocketlike for Twhere
T: FromRawFd,
impl<T> FromRawSocketlike for Twhere
T: FromRawFd,
source§unsafe fn from_raw_socketlike(raw: i32) -> T
unsafe fn from_raw_socketlike(raw: i32) -> T
Self
from the raw value. Read moresource§impl<T> FromSocketlike for T
impl<T> FromSocketlike for T
source§fn from_socketlike(owned: OwnedFd) -> T
fn from_socketlike(owned: OwnedFd) -> T
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,
Self
from the given socketlike object
converted from into_owned
.