Struct std::os::unix::io::OwnedFd
#[repr(transparent)]pub struct OwnedFd { /* fields omitted */ }
An owned file descriptor.
This closes the file descriptor on drop.
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
.
Trait Implementations
impl AsFd for OwnedFd
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
impl AsRawFd for OwnedFd
fn as_raw_fd(&self) -> RawFd
Extracts the raw file descriptor. Read more
impl Debug for OwnedFd
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the value using the given formatter. Read more
impl Drop for OwnedFd
impl From<ChildStderr> for OwnedFd
fn from(child_stderr: ChildStderr) -> OwnedFd
Performs the conversion.
impl From<ChildStdin> for OwnedFd
fn from(child_stdin: ChildStdin) -> OwnedFd
Performs the conversion.
impl From<ChildStdout> for OwnedFd
fn from(child_stdout: ChildStdout) -> OwnedFd
Performs the conversion.
impl From<File> for OwnedFd
fn from(file: File) -> OwnedFd
Performs the conversion.
impl From<OwnedFd> for UnixDatagram
fn from(owned: OwnedFd) -> Self
Performs the conversion.
impl From<OwnedFd> for UnixListener
fn from(fd: OwnedFd) -> UnixListener
Performs the conversion.
impl From<OwnedFd> for UnixStream
fn from(owned: OwnedFd) -> Self
Performs the conversion.
impl From<OwnedFd> for Stdio
fn from(fd: OwnedFd) -> Stdio
Performs the conversion.
fn from(fd: OwnedFd) -> Self
Performs the conversion.
impl From<OwnedFd> for File
fn from(owned_fd: OwnedFd) -> Self
Performs the conversion.
impl From<OwnedFd> for TcpStream
fn from(owned_fd: OwnedFd) -> Self
Performs the conversion.
impl From<OwnedFd> for TcpListener
fn from(owned_fd: OwnedFd) -> Self
Performs the conversion.
impl From<OwnedFd> for UdpSocket
fn from(owned_fd: OwnedFd) -> Self
Performs the conversion.
fn from(pid_fd: PidFd) -> Self
Performs the conversion.
impl From<TcpListener> for OwnedFd
fn from(tcp_listener: TcpListener) -> OwnedFd
Performs the conversion.
impl From<TcpStream> for OwnedFd
fn from(tcp_stream: TcpStream) -> OwnedFd
Performs the conversion.
impl From<UdpSocket> for OwnedFd
fn from(udp_socket: UdpSocket) -> OwnedFd
Performs the conversion.
impl From<UnixDatagram> for OwnedFd
fn from(unix_datagram: UnixDatagram) -> OwnedFd
Performs the conversion.
impl From<UnixListener> for OwnedFd
fn from(listener: UnixListener) -> OwnedFd
Performs the conversion.
impl From<UnixStream> for OwnedFd
fn from(unix_stream: UnixStream) -> OwnedFd
Performs the conversion.
impl FromRawFd for OwnedFd
unsafe fn from_raw_fd(fd: RawFd) -> Self
Constructs a new instance of Self
from the given raw file descriptor.
Safety
The resource pointed to by fd
must be open and suitable for assuming ownership. The resource must not require any cleanup other than close
.
impl IntoRawFd for OwnedFd
Auto Trait Implementations
impl RefUnwindSafe for OwnedFd
impl Send for OwnedFd
impl Sync for OwnedFd
impl Unpin for OwnedFd
impl UnwindSafe for OwnedFd
Blanket Implementations
impl<T> From<T> for T
pub fn from(t: T) -> T
Performs the conversion.
pub fn into(self) -> U
Performs the conversion.
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
Performs the conversion.
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
Performs the conversion.
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/os/unix/io/struct.OwnedFd.html