pub trait DescriptorFlags: Bitfield<u32> {
Show 38 methods
    // Provided methods
    fn system_type(&self) -> SystemDescriptorType { ... }
    fn application_accessed(&self) -> bool { ... }
    fn code_readable(&self) -> bool { ... }
    fn data_writable(&self) -> bool { ... }
    fn code_conforming(&self) -> bool { ... }
    fn data_expand_down(&self) -> bool { ... }
    fn is_code(&self) -> bool { ... }
    fn is_application(&self) -> bool { ... }
    fn privilege_level(&self) -> u8 { ... }
    fn present(&self) -> bool { ... }
    fn code_mode_64(&self) -> bool { ... }
    fn application_mode_32(&self) -> bool { ... }
    fn set_system_type(&mut self, value: SystemDescriptorType) { ... }
    fn with_system_type(&self, value: SystemDescriptorType) -> Self { ... }
    fn set_application_accessed(&mut self, value: bool) { ... }
    fn with_application_accessed(&mut self, value: bool) -> Self { ... }
    fn set_code_readable(&mut self, value: bool) { ... }
    fn with_code_readable(&mut self, value: bool) -> Self { ... }
    fn set_data_writable(&mut self, value: bool) { ... }
    fn with_data_writable(&mut self, value: bool) -> Self { ... }
    fn set_code_conforming(&mut self, value: bool) { ... }
    fn with_code_conforming(&mut self, value: bool) -> Self { ... }
    fn set_data_expand_down(&mut self, value: bool) { ... }
    fn with_data_expand_down(&mut self, value: bool) -> Self { ... }
    fn set_is_code(&mut self, value: bool) { ... }
    fn with_is_code(&mut self, value: bool) -> Self { ... }
    fn set_is_application(&mut self, value: bool) { ... }
    fn with_is_application(&mut self, value: bool) -> Self { ... }
    fn set_privilege_level(&mut self, value: u8) { ... }
    fn with_privilege_level(&self, value: u8) -> Self { ... }
    fn set_present(&mut self, value: bool) { ... }
    fn with_present(&mut self, value: bool) -> Self { ... }
    fn set_code_mode_64(&mut self, value: bool) { ... }
    fn with_code_mode_64(&mut self, value: bool) -> Self { ... }
    fn set_application_mode_32(&mut self, value: bool) { ... }
    fn with_application_mode_32(&mut self, value: bool) -> Self { ... }
    fn fmt_fields(&self, f: &mut DebugStruct<'_, '_>) { ... }
    fn is_gate(&self) -> bool { ... }
}Expand description
Settings common to SegmentDescriptors and GateDescriptors.
Provided Methods§
Sourcefn system_type(&self) -> SystemDescriptorType
 
fn system_type(&self) -> SystemDescriptorType
If this is a system descriptor, indicates which type.
Only applies if is_application is false.
Sourcefn application_accessed(&self) -> bool
 
fn application_accessed(&self) -> bool
The processor sets this bit whenever a segment register points to this segment.
The process never resets this itself, but it can be cleared manually.
Only applies if is_application is true.
Sourcefn code_readable(&self) -> bool
 
fn code_readable(&self) -> bool
If this is a code descriptor, indicates that the segment can be read. Otherwise, it is execute-only.
Only applies if is_application and
is_code are true.
Sourcefn data_writable(&self) -> bool
 
fn data_writable(&self) -> bool
If this is a data descriptor, indicates that this segment is writable.
Required for stack segments.
Only applies if is_application is true and
code_descriptor is false.
Sourcefn code_conforming(&self) -> bool
 
fn code_conforming(&self) -> bool
If this is a code descriptor, indicates that this segment can be executed
with lower privileges than privilege_level.
Only applies if is_application and
is_code are true.
Sourcefn data_expand_down(&self) -> bool
 
fn data_expand_down(&self) -> bool
If this is a data descriptor, indicates that the segment expands toward lower addresses (stack-like) if its limit is changed.
Only applies if is_application is true and
is_code is false.
Sourcefn is_code(&self) -> bool
 
fn is_code(&self) -> bool
Indicates whether this is a code (true) or data (false) descriptor.
Only applies if is_application is true.
Sourcefn is_application(&self) -> bool
 
fn is_application(&self) -> bool
S: Indicates that this is an application section descriptor if true.
Otherwise, this is a system descriptor.
Sourcefn privilege_level(&self) -> u8
 
fn privilege_level(&self) -> u8
DPL: The privilege level associated with the segment.
This has several meanings depending on the segment type:
- For stack segments, this is the exact privilege level required to use the segment as a stack.
 - For data segments, this is the minimum privilege (maximum number) required to access the segment.
 - For call gates, this is the minimum privilege (maximum number) required to use the gate.
 - For code segments:
- If the segment is accessed through a call gate or
code_conformingis true, this is the maximum privilege level (minimum number) that can execute the code. - Otherwise, it is the exact privilege level required to execute the code.
 
 - If the segment is accessed through a call gate or
 
Sourcefn code_mode_64(&self) -> bool
 Available on x86-64 only.
fn code_mode_64(&self) -> bool
L: If this is a code segment, indicates that it should be executed in 64-bit
mode.
Mutually exclusive with mode_32.
Only applies if all of the following are true:
Sourcefn application_mode_32(&self) -> bool
 
fn application_mode_32(&self) -> bool
D/B: Indicates that the segment uses 32-bit mode. Otherwise, it is 16-bit,
unless code_mode_64 is set.
Besides the address/operand sizes for instructions in code segments, this also
affects the upper bound of stack-like data segments with the
data_expand_down flag set.
Only applies if is_application is true.
Sourcefn set_system_type(&mut self, value: SystemDescriptorType)
 
fn set_system_type(&mut self, value: SystemDescriptorType)
If this is a system descriptor, indicates which type.
Only applies if is_application is false.
Sourcefn with_system_type(&self, value: SystemDescriptorType) -> Self
 
fn with_system_type(&self, value: SystemDescriptorType) -> Self
If this is a system descriptor, indicates which type.
Only applies if is_application is false.
Sourcefn set_application_accessed(&mut self, value: bool)
 
fn set_application_accessed(&mut self, value: bool)
The processor sets this bit whenever a segment register points to this segment.
The process never resets this itself, but it can be cleared manually.
Only applies if is_application is true.
Sourcefn with_application_accessed(&mut self, value: bool) -> Self
 
fn with_application_accessed(&mut self, value: bool) -> Self
The processor sets this bit whenever a segment register points to this segment.
The process never resets this itself, but it can be cleared manually.
Only applies if is_application is true.
Sourcefn set_code_readable(&mut self, value: bool)
 
fn set_code_readable(&mut self, value: bool)
If this is a code descriptor, indicates that the segment can be read. Otherwise, it is execute-only.
Only applies if is_application and
is_code are true.
Sourcefn with_code_readable(&mut self, value: bool) -> Self
 
fn with_code_readable(&mut self, value: bool) -> Self
If this is a code descriptor, indicates that the segment can be read. Otherwise, it is execute-only.
Only applies if is_application and
is_code are true.
Sourcefn set_data_writable(&mut self, value: bool)
 
fn set_data_writable(&mut self, value: bool)
If this is a data descriptor, indicates that this segment is writable.
Required for stack segments.
Only applies if is_application is true and
code_descriptor is false.
Sourcefn with_data_writable(&mut self, value: bool) -> Self
 
fn with_data_writable(&mut self, value: bool) -> Self
If this is a data descriptor, indicates that this segment is writable.
Required for stack segments.
Only applies if is_application is true and
code_descriptor is false.
Sourcefn set_code_conforming(&mut self, value: bool)
 
fn set_code_conforming(&mut self, value: bool)
If this is a code descriptor, indicates that this segment can be executed
with lower privileges than privilege_level.
Only applies if is_application and
is_code are true.
Sourcefn with_code_conforming(&mut self, value: bool) -> Self
 
fn with_code_conforming(&mut self, value: bool) -> Self
If this is a code descriptor, indicates that this segment can be executed
with lower privileges than privilege_level.
Only applies if is_application and
is_code are true.
Sourcefn set_data_expand_down(&mut self, value: bool)
 
fn set_data_expand_down(&mut self, value: bool)
If this is a data descriptor, indicates that the segment expands toward lower addresses (stack-like) if its limit is changed.
Only applies if is_application is true and
is_code is false.
Sourcefn with_data_expand_down(&mut self, value: bool) -> Self
 
fn with_data_expand_down(&mut self, value: bool) -> Self
If this is a data descriptor, indicates that the segment expands toward lower addresses (stack-like) if its limit is changed.
Only applies if is_application is true and
is_code is false.
Sourcefn set_is_code(&mut self, value: bool)
 
fn set_is_code(&mut self, value: bool)
Indicates whether this is a code (true) or data (false) descriptor.
Only applies if is_application is true.
Sourcefn with_is_code(&mut self, value: bool) -> Self
 
fn with_is_code(&mut self, value: bool) -> Self
Indicates whether this is a code (true) or data (false) descriptor.
Only applies if is_application is true.
Sourcefn set_is_application(&mut self, value: bool)
 
fn set_is_application(&mut self, value: bool)
S: Indicates that this is an application section descriptor if true.
Otherwise, this is a system descriptor.
Sourcefn with_is_application(&mut self, value: bool) -> Self
 
fn with_is_application(&mut self, value: bool) -> Self
S: Indicates that this is an application section descriptor if true.
Otherwise, this is a system descriptor.
Sourcefn set_privilege_level(&mut self, value: u8)
 
fn set_privilege_level(&mut self, value: u8)
DPL: The privilege level associated with the segment.
This has several meanings depending on the segment type:
- For stack segments, this is the exact privilege level required to use the segment as a stack.
 - For data segments, this is the minimum privilege (maximum number) required to access the segment.
 - For call gates, this is the minimum privilege (maximum number) required to use the gate.
 - For code segments:
- If the segment is accessed through a call gate or
code_conformingis true, this is the maximum privilege level (minimum number) that can execute the code. - Otherwise, it is the exact privilege level required to execute the code.
 
 - If the segment is accessed through a call gate or
 
Sourcefn with_privilege_level(&self, value: u8) -> Self
 
fn with_privilege_level(&self, value: u8) -> Self
DPL: The privilege level associated with the segment.
This has several meanings depending on the segment type:
- For stack segments, this is the exact privilege level required to use the segment as a stack.
 - For data segments, this is the minimum privilege (maximum number) required to access the segment.
 - For call gates, this is the minimum privilege (maximum number) required to use the gate.
 - For code segments:
- If the segment is accessed through a call gate or
code_conformingis true, this is the maximum privilege level (minimum number) that can execute the code. - Otherwise, it is the exact privilege level required to execute the code.
 
 - If the segment is accessed through a call gate or
 
Sourcefn set_present(&mut self, value: bool)
 
fn set_present(&mut self, value: bool)
P: Indicates that the segment is defined.
Sourcefn with_present(&mut self, value: bool) -> Self
 
fn with_present(&mut self, value: bool) -> Self
P: Indicates that the segment is defined.
Sourcefn set_code_mode_64(&mut self, value: bool)
 Available on x86-64 only.
fn set_code_mode_64(&mut self, value: bool)
L: If this is a code segment, indicates that it should be executed in 64-bit
mode.
Mutually exclusive with mode_32.
Only applies if all of the following are true:
Sourcefn with_code_mode_64(&mut self, value: bool) -> Self
 Available on x86-64 only.
fn with_code_mode_64(&mut self, value: bool) -> Self
L: If this is a code segment, indicates that it should be executed in 64-bit
mode.
Mutually exclusive with mode_32.
Only applies if all of the following are true:
Sourcefn set_application_mode_32(&mut self, value: bool)
 
fn set_application_mode_32(&mut self, value: bool)
D/B: Indicates that the segment uses 32-bit mode. Otherwise, it is 16-bit,
unless code_mode_64 is set.
Besides the address/operand sizes for instructions in code segments, this also
affects the upper bound of stack-like data segments with the
data_expand_down flag set.
Only applies if is_application is true.
Sourcefn with_application_mode_32(&mut self, value: bool) -> Self
 
fn with_application_mode_32(&mut self, value: bool) -> Self
D/B: Indicates that the segment uses 32-bit mode. Otherwise, it is 16-bit,
unless code_mode_64 is set.
Besides the address/operand sizes for instructions in code segments, this also
affects the upper bound of stack-like data segments with the
data_expand_down flag set.
Only applies if is_application is true.
Sourcefn fmt_fields(&self, f: &mut DebugStruct<'_, '_>)
 
fn fmt_fields(&self, f: &mut DebugStruct<'_, '_>)
Print this object’s bitfield values. Helper method for Debug
implementations.
Sourcefn is_gate(&self) -> bool
 
fn is_gate(&self) -> bool
Indicates that this is a GateDescriptor.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.