#[repr(u8)]pub enum PrivilegeLevel {
User = 0,
Supervisor = 1,
Machine = 3,
}Expand description
Privilege level of the hart.
Variants are assigned their architectural 2-bit encoding as discriminants
so that level as u8 yields the value that appears in CSR address bits
[9:8] and in mstatus/sstatus privilege fields.
The encoding 0b10 is architecturally reserved and is therefore absent.
Variants§
User = 0
User / application mode (least privileged)
Supervisor = 1
Supervisor mode
Machine = 3
Machine mode (most privileged)
Implementations§
Trait Implementations§
Source§impl Clone for PrivilegeLevel
impl Clone for PrivilegeLevel
Source§fn clone(&self) -> PrivilegeLevel
fn clone(&self) -> PrivilegeLevel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrivilegeLevel
impl Debug for PrivilegeLevel
Source§impl Default for PrivilegeLevel
impl Default for PrivilegeLevel
Source§fn default() -> PrivilegeLevel
fn default() -> PrivilegeLevel
Returns the “default value” for a type. Read more
Source§impl Ord for PrivilegeLevel
impl Ord for PrivilegeLevel
Source§fn cmp(&self, other: &PrivilegeLevel) -> Ordering
fn cmp(&self, other: &PrivilegeLevel) -> Ordering
1.21.0 · 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
Source§impl PartialEq for PrivilegeLevel
impl PartialEq for PrivilegeLevel
Source§impl PartialOrd for PrivilegeLevel
impl PartialOrd for PrivilegeLevel
impl Copy for PrivilegeLevel
impl Eq 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
Mutably borrows from an owned value. Read more