Skip to main content

SafeMemorySlotAccessOpInterface

Trait SafeMemorySlotAccessOpInterface 

Source
pub trait SafeMemorySlotAccessOpInterface: Op {
    // Required method
    fn ensure_only_safe_accesses(
        &self,
        ctx: &Context,
        value: &ValueSlot,
        must_be_safely_used: &mut Vec<ValueSlot>,
    ) -> LogicalResult;

    // Provided method
    fn verify(_op: &dyn Op, _ctx: &Context) -> Result<()>
       where Self: Sized { ... }
}

Required Methods§

Source

fn ensure_only_safe_accesses( &self, ctx: &Context, value: &ValueSlot, must_be_safely_used: &mut Vec<ValueSlot>, ) -> LogicalResult

Returns whether all accesses in this operation to the provided value are done in a safe manner. To be safe, the access must only access the value inside the bounds that its type implies.

If the safety of the accesses depends on the safety of the accesses to further value, the result of this method will be conditioned to the safety of the accesses to the value added by this method to must_be_safely_used.

No IR mutation is allowed in this method.

Provided Methods§

Source

fn verify(_op: &dyn Op, _ctx: &Context) -> Result<()>
where Self: Sized,

Trait Implementations§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§