Skip to main content

Plain

Trait Plain 

Source
pub trait Plain: Copy {
    // Required method
    fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>;
}
Expand description

A trait for types that can be extracted from snapshots in ghost code.

These are types that only contain plain data and whose ownership does not convey any additional information.

For example, Booleans and integers are plain, but references are not, be they mutable or not. Indeed, the ownership of a shared reference can be used to deduce facts, for example with Perm::disjoint_lemma.

Required Methods§

Source

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

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.

Implementations on Foreign Types§

Source§

impl Plain for bool

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for char

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for i8

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for i16

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for i32

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for i64

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for i128

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for isize

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for u8

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for u16

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for u32

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for u64

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for u128

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl Plain for usize

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl<T> Plain for *const T

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Source§

impl<T> Plain for *mut T

Source§

fn into_ghost(snap: Snapshot<Self>) -> Ghost<Self>

ensures

*result == *snap

terminates

ghost

Implementors§