#[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§

source§

impl PrivilegeLevel

source

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§

source§

impl Clone for PrivilegeLevel

source§

fn clone(&self) -> PrivilegeLevel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PrivilegeLevel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for PrivilegeLevel

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for PrivilegeLevel

source§

fn eq(&self, other: &PrivilegeLevel) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for PrivilegeLevel

source§

impl Eq for PrivilegeLevel

source§

impl StructuralPartialEq for PrivilegeLevel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.