#[repr(transparent)]pub struct SegmentSelector(pub u16);
Expand description
Specifies which element to load into a segment from descriptor tables (i.e., is a index to LDT or GDT table with some additional flags).
See Intel 3a, Section 3.4.2 “Segment Selectors”
Tuple Fields§
§0: u16
Implementations§
Source§impl SegmentSelector
impl SegmentSelector
Sourcepub const NULL: Self = _
pub const NULL: Self = _
Can be used as a selector into a non-existent segment and assigned to segment registers, e.g. data segment register in ring 0
Sourcepub const fn new(index: u16, rpl: PrivilegeLevel) -> SegmentSelector
pub const fn new(index: u16, rpl: PrivilegeLevel) -> SegmentSelector
Creates a new SegmentSelector
§Arguments
index
: index in GDT or LDT array (not the offset)rpl
: the requested privilege level
Sourcepub fn rpl(self) -> PrivilegeLevel
pub fn rpl(self) -> PrivilegeLevel
Returns the requested privilege level.
Sourcepub fn set_rpl(&mut self, rpl: PrivilegeLevel)
pub fn set_rpl(&mut self, rpl: PrivilegeLevel)
Set the privilege level for this Segment selector.
Trait Implementations§
Source§impl Clone for SegmentSelector
impl Clone for SegmentSelector
Source§fn clone(&self) -> SegmentSelector
fn clone(&self) -> SegmentSelector
Returns a copy 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 SegmentSelector
impl Debug for SegmentSelector
Source§impl Hash for SegmentSelector
impl Hash for SegmentSelector
Source§impl Ord for SegmentSelector
impl Ord for SegmentSelector
Source§fn cmp(&self, other: &SegmentSelector) -> Ordering
fn cmp(&self, other: &SegmentSelector) -> 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 SegmentSelector
impl PartialEq for SegmentSelector
Source§impl PartialOrd for SegmentSelector
impl PartialOrd for SegmentSelector
impl Copy for SegmentSelector
impl Eq for SegmentSelector
impl StructuralPartialEq for SegmentSelector
Auto Trait Implementations§
impl Freeze for SegmentSelector
impl RefUnwindSafe for SegmentSelector
impl Send for SegmentSelector
impl Sync for SegmentSelector
impl Unpin for SegmentSelector
impl UnwindSafe for SegmentSelector
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