#[repr(transparent)]pub struct OwnedFd { /* private fields */ }Expand description
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.
Implementations
Trait Implementations
impl AsFd for OwnedFd
source
impl AsFd for OwnedFd
sourcefn as_fd(&self) -> BorrowedFd<'_>
source
fn as_fd(&self) -> BorrowedFd<'_>
sourceBorrows the file descriptor. Read more
impl From<ChildStderr> for OwnedFd
source Available on Unix only.
impl From<ChildStderr> for OwnedFd
sourcefn from(child_stderr: ChildStderr) -> OwnedFd
source
fn from(child_stderr: ChildStderr) -> OwnedFd
sourceConverts to this type from the input type.
impl From<ChildStdin> for OwnedFd
source Available on Unix only.
impl From<ChildStdin> for OwnedFd
sourcefn from(child_stdin: ChildStdin) -> OwnedFd
source
fn from(child_stdin: ChildStdin) -> OwnedFd
sourceConverts to this type from the input type.
impl From<ChildStdout> for OwnedFd
source Available on Unix only.
impl From<ChildStdout> for OwnedFd
sourcefn from(child_stdout: ChildStdout) -> OwnedFd
source
fn from(child_stdout: ChildStdout) -> OwnedFd
sourceConverts to this type from the input type.
impl From<OwnedFd> for UnixDatagram
source Available on Unix only.
impl From<OwnedFd> for UnixDatagram
sourceimpl From<OwnedFd> for UnixListener
source Available on Unix only.
impl From<OwnedFd> for UnixListener
sourcefn from(fd: OwnedFd) -> UnixListener
source
fn from(fd: OwnedFd) -> UnixListener
sourceConverts to this type from the input type.
impl From<OwnedFd> for UnixStream
source Available on Unix only.
impl From<OwnedFd> for UnixStream
sourceimpl From<OwnedFd> for TcpListener
source
impl From<OwnedFd> for TcpListener
sourceimpl From<TcpListener> for OwnedFd
source
impl From<TcpListener> for OwnedFd
sourcefn from(tcp_listener: TcpListener) -> OwnedFd
source
fn from(tcp_listener: TcpListener) -> OwnedFd
sourceConverts to this type from the input type.
impl From<UnixDatagram> for OwnedFd
source Available on Unix only.
impl From<UnixDatagram> for OwnedFd
sourcefn from(unix_datagram: UnixDatagram) -> OwnedFd
source
fn from(unix_datagram: UnixDatagram) -> OwnedFd
sourceConverts to this type from the input type.
impl From<UnixListener> for OwnedFd
source Available on Unix only.
impl From<UnixListener> for OwnedFd
sourcefn from(listener: UnixListener) -> OwnedFd
source
fn from(listener: UnixListener) -> OwnedFd
sourceConverts to this type from the input type.
impl From<UnixStream> for OwnedFd
source Available on Unix only.
impl From<UnixStream> for OwnedFd
sourcefn from(unix_stream: UnixStream) -> OwnedFd
source
fn from(unix_stream: UnixStream) -> OwnedFd
sourceConverts to this type from the input type.
impl FromRawFd for OwnedFd
source
impl FromRawFd for OwnedFd
sourceunsafe fn from_raw_fd(fd: RawFd) -> Self
source Available on Unix only.
unsafe fn from_raw_fd(fd: RawFd) -> Self
sourceConstructs 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.
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> BorrowMut<T> for T where
T: ?Sized,
source
impl<T> BorrowMut<T> for T where
T: ?Sized,
sourcefn borrow_mut(&mut self) -> &mut T
const: unstable · source
fn borrow_mut(&mut self) -> &mut T
const: unstable · sourceMutably borrows from an owned value. Read more