pub enum Handle {
Null,
Pseudo(PseudoHandle),
Thread(ThreadId),
}
Expand description
Miri representation of a Windows HANDLE
Variants§
Implementations§
source§impl Handle
impl Handle
const NULL_DISCRIMINANT: u32 = 0u32
const PSEUDO_DISCRIMINANT: u32 = 1u32
const THREAD_DISCRIMINANT: u32 = 2u32
fn discriminant(self) -> u32
fn data(self) -> u32
fn packed_disc_size() -> u32
sourcefn to_packed(self) -> u32
fn to_packed(self) -> u32
Converts a handle into its machine representation.
The upper Self::packed_disc_size()
bits are used to store a discriminant corresponding to the handle variant.
The remaining bits are used for the variant’s field.
None of this layout is guaranteed to applications by Windows or Miri.
fn new(discriminant: u32, data: u32) -> Option<Self>
sourcefn from_packed(handle: u32) -> Option<Self>
fn from_packed(handle: u32) -> Option<Self>
see docs for to_packed
pub fn to_scalar(self, cx: &impl HasDataLayout) -> Scalar<Provenance>
pub fn from_scalar<'tcx>( handle: Scalar<Provenance>, cx: &impl HasDataLayout ) -> InterpResult<'tcx, Option<Self>>
Trait Implementations§
source§impl PartialEq<Handle> for Handle
impl PartialEq<Handle> for Handle
impl Copy for Handle
impl Eq for Handle
impl StructuralEq for Handle
impl StructuralPartialEq for Handle
Auto Trait Implementations§
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes
Size for each variant:
Null
: 0 bytesPseudo
: 4 bytesThread
: 4 bytes