Struct clircle::UnixIdentifier
source · pub struct UnixIdentifier { /* private fields */ }
Expand description
Implementation of Clircle
for Unix.
Implementations§
source§impl UnixIdentifier
impl UnixIdentifier
sourcepub unsafe fn try_from_raw_fd(fd: RawFd, owns_fd: bool) -> Result<Self>
pub unsafe fn try_from_raw_fd(fd: RawFd, owns_fd: bool) -> Result<Self>
Creates a UnixIdentifier
from a raw file descriptor. The preferred way to create a
UnixIdentifier
is through one of the TryFrom
implementations.
Safety
The owns_fd
argument should only be true, if the given file descriptor owns the resource
it points to (for example a file).
If it is true, a File
can be obtained back with Clircle::into_inner
, or it will be
closed when the UnixIdentifier
is dropped.
Errors
The underlying call to File::metadata
fails.
Trait Implementations§
source§impl Clircle for UnixIdentifier
impl Clircle for UnixIdentifier
source§fn surely_conflicts_with(&self, other: &Self) -> bool
fn surely_conflicts_with(&self, other: &Self) -> bool
This method implements the conflict check that is used in the GNU coreutils program cat
.
source§fn into_inner(self) -> Option<File>
fn into_inner(self) -> Option<File>
Returns the
File
that was used for From<File>
. If the instance was created otherwise,
this may also return None
.