Skip to main content

ResourceInvariant

Trait ResourceInvariant 

Source
pub trait ResourceInvariant<V>: Sized {
    type Constant;
    type Resource;

    // Required method
    spec fn inv(constant: Self::Constant, value: V, resource: Self::Resource) -> bool;
}
Expand description

An invariant that relates a value to a tracked resource.

Required Associated Types§

Source

type Constant

Immutable ghost configuration fixed at creation time.

Source

type Resource

A tracked resource associated with the value and transferred linearly between owners.

Required Methods§

Source

spec fn inv(constant: Self::Constant, value: V, resource: Self::Resource) -> bool

The relation that must hold between the value, constant, and tracked resource.

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.

Implementors§