Struct x86_64::registers::segmentation::SegmentSelector
source · #[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 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 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 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§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§impl PartialEq for SegmentSelector
impl PartialEq for SegmentSelector
source§fn eq(&self, other: &SegmentSelector) -> bool
fn eq(&self, other: &SegmentSelector) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.