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<'_>
Borrows the file descriptor. Read more
1.63.0 · Source§impl From<OwnedFd> for TcpListener
impl From<OwnedFd> for TcpListener
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 IntoRawFd for OwnedFd
impl IntoRawFd for OwnedFd
Source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
1.70.0 · Source§impl IsTerminal for OwnedFd
impl IsTerminal for OwnedFd
Source§fn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
Returns
true
if the descriptor/handle refers to a terminal/tty. Read moreAuto 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> 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