pub struct OwnedFd { /* private fields */ }Expand description
Owned file descriptor that closes the underlying descriptor on drop.
Implementations§
Source§impl OwnedFd
impl OwnedFd
Sourcepub const unsafe fn from_raw_fd(fd: RawFd) -> Self
pub const unsafe fn from_raw_fd(fd: RawFd) -> Self
Takes ownership of a raw file descriptor.
§Safety
fd must be an open, valid file descriptor uniquely owned by the caller.
Sourcepub const fn as_raw_fd(&self) -> RawFd
pub const fn as_raw_fd(&self) -> RawFd
Returns the underlying RawFd without releasing ownership.
Sourcepub const fn into_raw_fd(self) -> RawFd
pub const fn into_raw_fd(self) -> RawFd
Sourcepub const fn as_fd(&self) -> BorrowedFd<'_>
pub const fn as_fd(&self) -> BorrowedFd<'_>
Borrows this descriptor as a BorrowedFd.
Trait Implementations§
impl Eq for OwnedFd
Source§impl Ord for OwnedFd
impl Ord for OwnedFd
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for OwnedFd
impl PartialOrd for OwnedFd
impl StructuralPartialEq for OwnedFd
Auto Trait Implementations§
impl Forget for OwnedFd
impl Freeze for OwnedFd
impl Move for OwnedFd
impl RefUnwindSafe for OwnedFd
impl Send for OwnedFd
impl Sync for OwnedFd
impl Unpin for OwnedFd
impl UnsafeUnpin 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