pub struct FileAttributes(/* private fields */);Expand description
The attributes a file is created with: a set of ARCHIVE, HIDDEN, OFFLINE, READONLY, SYSTEM
and TEMPORARY, named as CreateFileW names FILE_ATTRIBUTE_* without their prefix.
use win_durable_ioring::windows_backend::FileAttributes;
let attributes = FileAttributes::HIDDEN | FileAttributes::SYSTEM;
assert!(attributes.contains(FileAttributes::HIDDEN));
assert!(!attributes.contains(FileAttributes::READONLY));
assert!(FileAttributes::NONE.is_empty());They apply to a file the open creates. The CreateFileW page says that for a file that exists the
supplied attributes are generally combined with it or ignored, which is Win32’s and is not
refined here; FileOptions::attributes says what was measured.
The page also says applications should not change OFFLINE arbitrarily.
The empty set asks for no attribute and is what an open passes when none is given; it is not
FILE_ATTRIBUTE_NORMAL, which the page defines as valid only alone.
Implementations§
Source§impl FileAttributes
impl FileAttributes
Sourcepub const HIDDEN: Self
pub const HIDDEN: Self
FILE_ATTRIBUTE_HIDDEN: the file is hidden, and not included in an ordinary directory listing.
Sourcepub const OFFLINE: Self
pub const OFFLINE: Self
FILE_ATTRIBUTE_OFFLINE: the data is not immediately available, because it has been moved to
offline storage. The CreateFileW page says an application should not change it arbitrarily.
Sourcepub const READONLY: Self
pub const READONLY: Self
FILE_ATTRIBUTE_READONLY: the file can be read and not written or deleted.
Trait Implementations§
Source§impl BitOr for FileAttributes
impl BitOr for FileAttributes
Source§impl BitOrAssign for FileAttributes
impl BitOrAssign for FileAttributes
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|= operation. Read more