Struct cap_primitives::fs::FileType
source · [−]#[repr(transparent)]pub struct FileType(_);
Expand description
A structure representing a type of file with accessors for each file type.
This corresponds to std::fs::FileType
.
We need to define our own version because the libstd `FileType` doesn't
have a public constructor that we can use.
Implementations
sourceimpl FileType
impl FileType
sourcepub fn is_dir(&self) -> bool
pub fn is_dir(&self) -> bool
Tests whether this file type represents a directory.
This corresponds to std::fs::FileType::is_dir
.
sourcepub fn is_file(&self) -> bool
pub fn is_file(&self) -> bool
Tests whether this file type represents a regular file.
This corresponds to std::fs::FileType::is_file
.
sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Tests whether this file type represents a symbolic link.
This corresponds to std::fs::FileType::is_symlink
.
Trait Implementations
sourceimpl FileTypeExt for FileType
impl FileTypeExt for FileType
sourcefn is_block_device(&self) -> bool
fn is_block_device(&self) -> bool
Returns true
if this file type is a block device. Read more
sourcefn is_char_device(&self) -> bool
fn is_char_device(&self) -> bool
Returns true
if this file type is a char device. Read more
impl Copy for FileType
impl Eq for FileType
impl StructuralEq for FileType
impl StructuralPartialEq for FileType
Auto Trait Implementations
impl RefUnwindSafe for FileType
impl Send for FileType
impl Sync for FileType
impl Unpin for FileType
impl UnwindSafe for FileType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more