pub struct Caps(/* private fields */);Expand description
Implementations§
Source§impl Caps
impl Caps
Sourcepub const fn from_words(words: [u64; 4]) -> Self
pub const fn from_words(words: [u64; 4]) -> Self
Create a capability set from raw words.
This is primarily useful for serialization and testing.
Sourcepub const fn has(self, required: Self) -> bool
pub const fn has(self, required: Self) -> bool
Check if all features in required are present.
§Examples
use rscrypto::platform::Caps;
let caps = rscrypto::platform::caps();
assert!(caps.has(Caps::NONE));Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Intersection of two capability sets.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Set difference: returns bits in self that are not in other.
Equivalent to self & !other in bitwise terms.
Trait Implementations§
Source§impl BitOrAssign for Caps
impl BitOrAssign for Caps
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|= operation. Read moreimpl Copy for Caps
impl Eq for Caps
impl StructuralPartialEq for Caps
Auto Trait Implementations§
impl Freeze for Caps
impl RefUnwindSafe for Caps
impl Send for Caps
impl Sync for Caps
impl Unpin for Caps
impl UnsafeUnpin for Caps
impl UnwindSafe for Caps
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more