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 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(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
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 ==
.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
Mutably borrows from an owned value. Read more
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>,
Casts the value.
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>
Casts the value.
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
§impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.