pub enum SecurityLevel {
Public,
Internal,
Confidential,
Secret,
}Expand description
Security classification levels forming a lattice.
Variants§
Public
Publicly accessible data
Internal
Internal use only (within organization)
Confidential
Confidential data (restricted access)
Secret
Secret data (highest classification)
Implementations§
Source§impl SecurityLevel
impl SecurityLevel
Sourcepub const TOP: SecurityLevel = SecurityLevel::Secret
pub const TOP: SecurityLevel = SecurityLevel::Secret
Top element of the lattice.
Sourcepub const BOT: SecurityLevel = SecurityLevel::Public
pub const BOT: SecurityLevel = SecurityLevel::Public
Bottom element of the lattice.
Sourcepub const ALL: [SecurityLevel; 4]
pub const ALL: [SecurityLevel; 4]
All levels from lowest to highest.
Sourcepub const fn from_u8(value: u8) -> Option<SecurityLevel>
pub const fn from_u8(value: u8) -> Option<SecurityLevel>
Try to convert from u8.
Sourcepub const fn flows_to(self, other: SecurityLevel) -> bool
pub const fn flows_to(self, other: SecurityLevel) -> bool
Information flow relation: data at self can flow to other.
Sourcepub const fn can_communicate(self, other: SecurityLevel) -> bool
pub const fn can_communicate(self, other: SecurityLevel) -> bool
Check if information can flow in either direction.
Sourcepub const fn join(self, other: SecurityLevel) -> SecurityLevel
pub const fn join(self, other: SecurityLevel) -> SecurityLevel
Least upper bound (join) – the higher of two levels.
Sourcepub const fn meet(self, other: SecurityLevel) -> SecurityLevel
pub const fn meet(self, other: SecurityLevel) -> SecurityLevel
Greatest lower bound (meet) – the lower of two levels.
Sourcepub const fn top() -> SecurityLevel
pub const fn top() -> SecurityLevel
Get the top (highest) security level.
Sourcepub const fn bot() -> SecurityLevel
pub const fn bot() -> SecurityLevel
Get the bottom (lowest) security level.
Trait Implementations§
Source§impl Clone for SecurityLevel
impl Clone for SecurityLevel
Source§fn clone(&self) -> SecurityLevel
fn clone(&self) -> SecurityLevel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SecurityLevel
Source§impl Debug for SecurityLevel
impl Debug for SecurityLevel
Source§impl Default for SecurityLevel
impl Default for SecurityLevel
Source§fn default() -> SecurityLevel
fn default() -> SecurityLevel
Returns the “default value” for a type. Read more
Source§impl Display for SecurityLevel
impl Display for SecurityLevel
impl Eq for SecurityLevel
Source§impl FromStr for SecurityLevel
impl FromStr for SecurityLevel
Source§type Err = ParseSecurityLevelError
type Err = ParseSecurityLevelError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<SecurityLevel, <SecurityLevel as FromStr>::Err>
fn from_str(s: &str) -> Result<SecurityLevel, <SecurityLevel as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for SecurityLevel
impl Hash for SecurityLevel
Source§impl Ord for SecurityLevel
impl Ord for SecurityLevel
Source§fn cmp(&self, other: &SecurityLevel) -> Ordering
fn cmp(&self, other: &SecurityLevel) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for SecurityLevel
impl PartialEq for SecurityLevel
Source§impl PartialOrd for SecurityLevel
impl PartialOrd for SecurityLevel
impl StructuralPartialEq for SecurityLevel
Auto Trait Implementations§
impl Forget for SecurityLevel
impl Freeze for SecurityLevel
impl Move for SecurityLevel
impl RefUnwindSafe for SecurityLevel
impl Send for SecurityLevel
impl Sync for SecurityLevel
impl Unpin for SecurityLevel
impl UnsafeUnpin for SecurityLevel
impl UnwindSafe for SecurityLevel
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