Struct SegmentSelector
#[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: u16Implementations§
§impl SegmentSelector
impl SegmentSelector
pub const NULL: SegmentSelector
pub const NULL: SegmentSelector
Can be used as a selector into a non-existent segment and assigned to segment registers, e.g. data segment register in ring 0
pub 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
pub fn rpl(self) -> PrivilegeLevel
pub fn rpl(self) -> PrivilegeLevel
Returns the requested privilege level.
pub 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§
§impl Clone for SegmentSelector
impl Clone for SegmentSelector
§fn clone(&self) -> SegmentSelector
fn clone(&self) -> SegmentSelector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SegmentSelector
§impl Debug for SegmentSelector
impl Debug for SegmentSelector
impl Eq for SegmentSelector
§impl Hash for SegmentSelector
impl Hash for SegmentSelector
§impl Ord for SegmentSelector
impl Ord for SegmentSelector
§fn cmp(&self, other: &SegmentSelector) -> Ordering
fn cmp(&self, other: &SegmentSelector) -> Ordering
1.21.0 (const: unstable) · 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
§impl PartialEq for SegmentSelector
impl PartialEq for SegmentSelector
§impl PartialOrd for SegmentSelector
impl PartialOrd 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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more