Skip to main content

MetaObj

Trait MetaObj 

Source
pub trait MetaObj: Any {
    // Required method
    fn opaque(&self) -> bool;

    // Provided method
    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!

Required Methods§

Source

fn opaque(&self) -> bool

Determines whether this object is opaque. Opaque objects have their memory contents reset to “uninit” on creation, and are implicitly removed on writes.

Provided Methods§

Source

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

Determines whether reads/writes to this object’s location are currently permitted.

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§