Struct rustix::fd::OwnedFd [−][src]
#[repr(transparent)]pub struct OwnedFd { /* fields omitted */ }
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
.
Trait Implementations
Borrows the file descriptor. Read more
Constructs a new instance of Self
from the given raw file descriptor.
Safety
The resource pointed to by raw
must be open and suitable for assuming
ownership.
Auto Trait Implementations
impl RefUnwindSafe for OwnedFd
impl UnwindSafe for OwnedFd
Blanket Implementations
Borrows the reference. Read more
pub fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target> where
Target: FromFilelike + IntoFilelike,
pub fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target> where
Target: FromFilelike + IntoFilelike,
Return a borrowing view of a resource which dereferences to a &Target
or &mut Target
. Read more
Returns the raw value.
Returns the raw value.
Borrows the reference.
pub fn as_socketlike_view<Target>(&self) -> FilelikeView<'_, Target> where
Target: FromSocketlike + IntoSocketlike,
pub fn as_socketlike_view<Target>(&self) -> FilelikeView<'_, Target> where
Target: FromSocketlike + IntoSocketlike,
Return a borrowing view of a resource which dereferences to a &Target
or &mut Target
. Read more
Mutably borrows from an owned value. Read more
Constructs Self
from the raw value.
Constructs Self
from the raw value.
Constructs a new instance of Self
from the given socketlike object.
Constructs a new instance of Self
from the given socketlike object
converted from into_owned
. Read more
Consumes this object, returning the underlying filelike object. Read more
Returns the raw value.
Consumes this object, returning the underlying socketlike object.