#[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
const LOCAL_BITS: usize = 1usize
const LOCAL_OFFSET: usize = 2usize
const INDEX_BITS: usize = 13usize
const INDEX_OFFSET: usize = 3usize
sourcepub const fn with_privilege_checked(self, value: Ring) -> Result<Self, ()>
pub const fn with_privilege_checked(self, value: Ring) -> Result<Self, ()>
Requested privilege level
Bits: 0..2
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
sourcepub fn set_privilege_checked(&mut self, value: Ring) -> Result<(), ()>
pub fn set_privilege_checked(&mut self, value: Ring) -> Result<(), ()>
Requested privilege level
Bits: 0..2
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 const fn with_local_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_local_checked(self, value: bool) -> Result<Self, ()>
Whether this selector corresponds to a global or local descriptor table
Bits: 2..3
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 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
sourcepub fn set_local_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_local_checked(&mut self, value: bool) -> Result<(), ()>
Whether this selector corresponds to a global or local descriptor table
Bits: 2..3
sourcepub const fn with_index_checked(self, value: u16) -> Result<Self, ()>
pub const fn with_index_checked(self, value: u16) -> Result<Self, ()>
Index within the descriptor table
Bits: 3..16
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
sourcepub fn set_index_checked(&mut self, value: u16) -> Result<(), ()>
pub fn set_index_checked(&mut self, value: u16) -> Result<(), ()>
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
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
source§impl From<u16> for SegmentSelector
impl From<u16> for SegmentSelector
source§impl PartialEq for SegmentSelector
impl PartialEq 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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)