pub struct FileRights(/* private fields */);Expand description
A set of file access rights other than the data rights, which are the
DataAccess of the handle.
Each member is one right the documentation lists for a file, named as CreateFileW names it
without its prefix: WRITE_ATTRIBUTES is FILE_WRITE_ATTRIBUTES, and
the standard rights keep their names. A set is made by joining them with |:
use win_durable_ioring::windows_backend::FileRights;
let rights = FileRights::READ_ATTRIBUTES | FileRights::WRITE_ATTRIBUTES;
assert!(rights.contains(FileRights::WRITE_ATTRIBUTES));
assert!(!rights.contains(FileRights::DELETE));
assert!(FileRights::NONE.is_empty());There is no generic right and no FILE_ALL_ACCESS. A generic right mixes the data rights, which
are a type, with others, and the kernel expands it when it opens, so a set could not say what it
holds. Ask for the data access with FileOptions::read and
write, and for the rest with the members here.
Append-only access is not offered, by construction: there is no member for FILE_APPEND_DATA,
and no data access asks for it. A write through a handle opened for appending only lands at the end
of the file whatever offset it names, and the core addresses every write by offset.
The set has no constructor from a raw mask. A right Win32 defines and this table does not list cannot be expressed until the table gains it.
Implementations§
Source§impl FileRights
impl FileRights
Sourcepub const READ_ATTRIBUTES: Self
pub const READ_ATTRIBUTES: Self
FILE_READ_ATTRIBUTES: read the file’s attributes.
Sourcepub const WRITE_ATTRIBUTES: Self
pub const WRITE_ATTRIBUTES: Self
FILE_WRITE_ATTRIBUTES: write the file’s attributes, among them its times.
Sourcepub const READ_CONTROL: Self
pub const READ_CONTROL: Self
READ_CONTROL: read the file’s security descriptor, without its system ACL.
Sourcepub const WRITE_OWNER: Self
pub const WRITE_OWNER: Self
WRITE_OWNER: change the file’s owner.
Sourcepub const SYNCHRONIZE: Self
pub const SYNCHRONIZE: Self
SYNCHRONIZE: wait on the handle.
Sourcepub const ACCESS_SYSTEM_SECURITY: Self
pub const ACCESS_SYSTEM_SECURITY: Self
ACCESS_SYSTEM_SECURITY: read and change the file’s system ACL. A caller the kernel does
not allow it gets the kernel’s error from the open.
Source§impl FileRights
impl FileRights
Trait Implementations§
Source§impl BitOr for FileRights
impl BitOr for FileRights
Source§impl BitOrAssign for FileRights
impl BitOrAssign for FileRights
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|= operation. Read more