Struct yubihsm::domain::Domain [−]
pub struct Domain { /* fields omitted */ }
Logical partition within the YubiHSM2
, allowing several clients
to access the same device but access controlled on a domain-by-domain
basis. For more information, see the Yubico documentation:
Methods
impl Domain
impl Domain
pub const DOM1: Domain
DOM1: Domain = Domain{bits: 1,}
pub const DOM2: Domain
DOM2: Domain = Domain{bits: 2,}
pub const DOM3: Domain
DOM3: Domain = Domain{bits: 4,}
pub const DOM4: Domain
DOM4: Domain = Domain{bits: 8,}
pub const DOM5: Domain
DOM5: Domain = Domain{bits: 16,}
pub const DOM6: Domain
DOM6: Domain = Domain{bits: 32,}
pub const DOM7: Domain
DOM7: Domain = Domain{bits: 64,}
pub const DOM8: Domain
DOM8: Domain = Domain{bits: 128,}
pub const DOM9: Domain
DOM9: Domain = Domain{bits: 256,}
pub const DOM10: Domain
DOM10: Domain = Domain{bits: 512,}
pub const DOM11: Domain
DOM11: Domain = Domain{bits: 1024,}
pub const DOM12: Domain
DOM12: Domain = Domain{bits: 2048,}
pub const DOM13: Domain
DOM13: Domain = Domain{bits: 4096,}
pub const DOM14: Domain
DOM14: Domain = Domain{bits: 8192,}
pub const DOM15: Domain
DOM15: Domain = Domain{bits: 16384,}
pub const DOM16: Domain
DOM16: Domain = Domain{bits: 32768,}
pub fn empty() -> Domain
pub fn empty() -> Domain
Returns an empty set of flags.
pub fn all() -> Domain
pub fn all() -> Domain
Returns the set containing all flags.
pub fn bits(&self) -> u16
pub fn bits(&self) -> u16
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u16) -> Option<Domain>
pub fn from_bits(bits: u16) -> Option<Domain>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u16) -> Domain
pub fn from_bits_truncate(bits: u16) -> Domain
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub fn is_all(&self) -> bool
pub fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub fn intersects(&self, other: Domain) -> bool
pub fn intersects(&self, other: Domain) -> bool
Returns true
if there are flags common to both self
and other
.
pub fn contains(&self, other: Domain) -> bool
pub fn contains(&self, other: Domain) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: Domain)
pub fn insert(&mut self, other: Domain)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: Domain)
pub fn remove(&mut self, other: Domain)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: Domain)
pub fn toggle(&mut self, other: Domain)
Toggles the specified flags in-place.
pub fn set(&mut self, other: Domain, value: bool)
pub fn set(&mut self, other: Domain, value: bool)
Inserts or removes the specified flags depending on the passed value.
impl Domain
[src]
impl Domain
pub fn at(index: usize) -> Result<Self, Error>
[src]
pub fn at(index: usize) -> Result<Self, Error>
Get the Domain
object corresponding to the given-numbered domain
e.g. Domain::at(1)
returns Domain::DOM1
.
Trait Implementations
impl Copy for Domain
impl Copy for Domain
impl PartialEq for Domain
impl PartialEq for Domain
fn eq(&self, other: &Domain) -> bool
fn eq(&self, other: &Domain) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Domain) -> bool
fn ne(&self, other: &Domain) -> bool
This method tests for !=
.
impl Eq for Domain
impl Eq for Domain
impl Clone for Domain
impl Clone for Domain
fn clone(&self) -> Domain
fn clone(&self) -> Domain
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialOrd for Domain
impl PartialOrd for Domain
fn partial_cmp(&self, other: &Domain) -> Option<Ordering>
fn partial_cmp(&self, other: &Domain) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Domain) -> bool
fn lt(&self, other: &Domain) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Domain) -> bool
fn le(&self, other: &Domain) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Domain) -> bool
fn gt(&self, other: &Domain) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Domain) -> bool
fn ge(&self, other: &Domain) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Domain
impl Ord for Domain
fn cmp(&self, other: &Domain) -> Ordering
fn cmp(&self, other: &Domain) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for Domain
impl Hash for Domain
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Domain
impl Debug for Domain
impl Binary for Domain
impl Binary for Domain
impl Octal for Domain
impl Octal for Domain
impl LowerHex for Domain
impl LowerHex for Domain
impl UpperHex for Domain
impl UpperHex for Domain
impl BitOr for Domain
impl BitOr for Domain
type Output = Domain
The resulting type after applying the |
operator.
fn bitor(self, other: Domain) -> Domain
fn bitor(self, other: Domain) -> Domain
Returns the union of the two sets of flags.
impl BitOrAssign for Domain
impl BitOrAssign for Domain
fn bitor_assign(&mut self, other: Domain)
fn bitor_assign(&mut self, other: Domain)
Adds the set of flags.
impl BitXor for Domain
impl BitXor for Domain
type Output = Domain
The resulting type after applying the ^
operator.
fn bitxor(self, other: Domain) -> Domain
fn bitxor(self, other: Domain) -> Domain
Returns the left flags, but with all the right flags toggled.
impl BitXorAssign for Domain
impl BitXorAssign for Domain
fn bitxor_assign(&mut self, other: Domain)
fn bitxor_assign(&mut self, other: Domain)
Toggles the set of flags.
impl BitAnd for Domain
impl BitAnd for Domain
type Output = Domain
The resulting type after applying the &
operator.
fn bitand(self, other: Domain) -> Domain
fn bitand(self, other: Domain) -> Domain
Returns the intersection between the two sets of flags.
impl BitAndAssign for Domain
impl BitAndAssign for Domain
fn bitand_assign(&mut self, other: Domain)
fn bitand_assign(&mut self, other: Domain)
Disables all flags disabled in the set.
impl Sub for Domain
impl Sub for Domain
type Output = Domain
The resulting type after applying the -
operator.
fn sub(self, other: Domain) -> Domain
fn sub(self, other: Domain) -> Domain
Returns the set difference of the two sets of flags.
impl SubAssign for Domain
impl SubAssign for Domain
fn sub_assign(&mut self, other: Domain)
fn sub_assign(&mut self, other: Domain)
Disables all flags enabled in the set.
impl Not for Domain
impl Not for Domain
type Output = Domain
The resulting type after applying the !
operator.
fn not(self) -> Domain
fn not(self) -> Domain
Returns the complement of this set of flags.
impl Extend<Domain> for Domain
impl Extend<Domain> for Domain
fn extend<T: IntoIterator<Item = Domain>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Domain>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<Domain> for Domain
impl FromIterator<Domain> for Domain
fn from_iter<T: IntoIterator<Item = Domain>>(iterator: T) -> Domain
fn from_iter<T: IntoIterator<Item = Domain>>(iterator: T) -> Domain
Creates a value from an iterator. Read more
impl Serialize for Domain
[src]
impl Serialize for Domain
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Domain
[src]
impl<'de> Deserialize<'de> for Domain
fn deserialize<D>(deserializer: D) -> Result<Domain, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Domain, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more