Struct rstubs::arch::gdt::SegmentSelector
source · #[repr(transparent)]pub struct SegmentSelector(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
const PRIVILEGE_BITS: usize = 2usize
const PRIVILEGE_OFFSET: usize = 0usize
sourcepub const fn with_privilege(self, value: Ring) -> Self
pub const fn with_privilege(self, value: Ring) -> Self
Requested privilege level
Bits: 0..2
sourcepub fn set_privilege(&mut self, value: Ring)
pub fn set_privilege(&mut self, value: Ring)
Requested privilege level
Bits: 0..2
const LOCAL_BITS: usize = 1usize
const LOCAL_OFFSET: usize = 2usize
sourcepub const fn with_local(self, value: bool) -> Self
pub const fn with_local(self, value: bool) -> Self
Whether this selector corresponds to a global or local descriptor table
Bits: 2..3
sourcepub const fn local(&self) -> bool
pub const fn local(&self) -> bool
Whether this selector corresponds to a global or local descriptor table
Bits: 2..3
sourcepub fn set_local(&mut self, value: bool)
pub fn set_local(&mut self, value: bool)
Whether this selector corresponds to a global or local descriptor table
Bits: 2..3
const INDEX_BITS: usize = 13usize
const INDEX_OFFSET: usize = 3usize
sourcepub const fn with_index(self, value: u16) -> Self
pub const fn with_index(self, value: u16) -> Self
Index within the descriptor table
Bits: 3..16
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 Default for SegmentSelector
impl Default for SegmentSelector
source§impl From<SegmentSelector> for u16
impl From<SegmentSelector> for u16
source§fn from(v: SegmentSelector) -> u16
fn from(v: SegmentSelector) -> u16
Converts to this type from the input type.
source§impl From<u16> for SegmentSelector
impl From<u16> 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 ==
.