Enum PrivilegeLevel
#[repr(u8)]pub enum PrivilegeLevel {
Ring0 = 0,
Ring1 = 1,
Ring2 = 2,
Ring3 = 3,
}Expand description
Represents a protection ring level.
Variants§
Ring0 = 0
Privilege-level 0 (most privilege): This level is used by critical system-software components that require direct access to, and control over, all processor and system resources. This can include BIOS, memory-management functions, and interrupt handlers.
Ring1 = 1
Privilege-level 1 (moderate privilege): This level is used by less-critical system- software services that can access and control a limited scope of processor and system resources. Software running at these privilege levels might include some device drivers and library routines. The actual privileges of this level are defined by the operating system.
Ring2 = 2
Privilege-level 2 (moderate privilege): Like level 1, this level is used by less-critical system-software services that can access and control a limited scope of processor and system resources. The actual privileges of this level are defined by the operating system.
Ring3 = 3
Privilege-level 3 (least privilege): This level is used by application software. Software running at privilege-level 3 is normally prevented from directly accessing most processor and system resources. Instead, applications request access to the protected processor and system resources by calling more-privileged service routines to perform the accesses.
Implementations§
§impl PrivilegeLevel
impl PrivilegeLevel
pub const fn from_u16(value: u16) -> PrivilegeLevel
pub const fn from_u16(value: u16) -> PrivilegeLevel
Creates a PrivilegeLevel from a numeric value. The value must be in the range 0..4.
This function panics if the passed value is >3.
Trait Implementations§
§impl Clone for PrivilegeLevel
impl Clone for PrivilegeLevel
§fn clone(&self) -> PrivilegeLevel
fn clone(&self) -> PrivilegeLevel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PrivilegeLevel
§impl Debug for PrivilegeLevel
impl Debug for PrivilegeLevel
impl Eq for PrivilegeLevel
§impl Hash for PrivilegeLevel
impl Hash for PrivilegeLevel
§impl PartialEq for PrivilegeLevel
impl PartialEq for PrivilegeLevel
impl StructuralPartialEq for PrivilegeLevel
Auto Trait Implementations§
impl Freeze for PrivilegeLevel
impl RefUnwindSafe for PrivilegeLevel
impl Send for PrivilegeLevel
impl Sync for PrivilegeLevel
impl Unpin for PrivilegeLevel
impl UnsafeUnpin for PrivilegeLevel
impl UnwindSafe for PrivilegeLevel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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