Struct io_conformance_util::flags::Rights
source · pub struct Rights { /* private fields */ }
Expand description
Helper struct that encapsulates generation of valid/invalid sets of flags based on which rights are supported by a particular node type.
Implementations§
source§impl Rights
impl Rights
sourcepub fn new(rights: OpenFlags) -> Rights
pub fn new(rights: OpenFlags) -> Rights
Creates a new Rights struct based on a bitset of OPEN_RIGHT_* flags OR’d together.
sourcepub fn valid_combos(&self) -> Vec<OpenFlags>
pub fn valid_combos(&self) -> Vec<OpenFlags>
Returns a vector of all valid flag combinations.
sourcepub fn valid_combos_with(&self, with_flags: OpenFlags) -> Vec<OpenFlags>
pub fn valid_combos_with(&self, with_flags: OpenFlags) -> Vec<OpenFlags>
Returns a vector of all valid flag combinations that include the specified with_flags
.
Will be empty if none of the requested rights are supported.
sourcepub fn valid_combos_without(&self, without_flags: OpenFlags) -> Vec<OpenFlags>
pub fn valid_combos_without(&self, without_flags: OpenFlags) -> Vec<OpenFlags>
Returns a vector of all valid flag combinations that exclude the specified without_flags
.
Will be empty if none are supported.
Auto Trait Implementations§
impl RefUnwindSafe for Rights
impl Send for Rights
impl Sync for Rights
impl Unpin for Rights
impl UnwindSafe for Rights
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more