Skip to main content

MetaObj

Trait MetaObj 

Source
pub trait MetaObj: Any {
    // Provided methods
    fn opaque(&self) -> bool { ... }
    fn on_access<'tcx>(&self) -> InterpResult<'tcx> { ... }
}
Expand description

A trait for the synchronization metadata that can be attached to a memory location. Must not contain any provenance!

Provided Methods§

Source

fn opaque(&self) -> bool

Determines whether this object is opaque, which means that the underlying memory is “hidden” from the program for as long as the meta object exists. Opaque objects have their memory contents reset to “uninit” on creation, and are implicitly removed on writes.

Source

fn on_access<'tcx>(&self) -> InterpResult<'tcx>

Determines whether reads/writes to this object’s location are currently permitted. The default is to allow them, but treat the object as opaque (see above), which means reads will return Uninit and writes will destroy the meta object.

Implementations§

Source§

impl dyn MetaObj

Source

pub fn downcast_ref<T: Any>(&self) -> Option<&T>

Source

pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>

Source

pub fn downcast<T: Any>(self: Box<Self>) -> Option<Box<T>>

Trait Implementations§

Source§

impl Debug for dyn MetaObj

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§