Trait vstd::view::View

source ·
pub trait View {
    type V;

    // Required method
    spec fn view(&self) -> Self::V;
}
Expand description

Types used in executable code can implement View to provide a mathematical abstraction of the type. For example, Vec implements a view method that returns a Seq. For base types like bool and u8, the view V of the type is the type itself. Types only used in ghost code, such as int, nat, and Seq, do not need to implement View.

Required Associated Types§

source

type V

Required Methods§

source

spec fn view(&self) -> Self::V

Implementations on Foreign Types§

source§

impl View for bool

§

type V = bool

source§

fn view(&self) -> bool

source§

impl View for char

§

type V = char

source§

fn view(&self) -> char

source§

impl View for i8

§

type V = i8

source§

fn view(&self) -> i8

source§

impl View for i16

§

type V = i16

source§

fn view(&self) -> i16

source§

impl View for i32

§

type V = i32

source§

fn view(&self) -> i32

source§

impl View for i64

§

type V = i64

source§

fn view(&self) -> i64

source§

impl View for i128

§

type V = i128

source§

fn view(&self) -> i128

source§

impl View for isize

§

type V = isize

source§

fn view(&self) -> isize

source§

impl View for str

source§

spec fn view(&self) -> Seq<char>

§

type V = Seq<char>

source§

impl View for u8

§

type V = u8

source§

fn view(&self) -> u8

source§

impl View for u16

§

type V = u16

source§

fn view(&self) -> u16

source§

impl View for u32

§

type V = u32

source§

fn view(&self) -> u32

source§

impl View for u64

§

type V = u64

source§

fn view(&self) -> u64

source§

impl View for u128

§

type V = u128

source§

fn view(&self) -> u128

source§

impl View for ()

§

type V = ()

source§

fn view(&self)

source§

impl View for usize

§

type V = usize

source§

fn view(&self) -> usize

source§

impl View for String

source§

spec fn view(&self) -> Seq<char>

§

type V = Seq<char>

source§

impl View for DefaultHasher

source§

closed spec fn view(&self) -> Seq<Seq<u8>>

§

type V = Seq<Seq<u8>>

source§

impl<A0: View> View for (A0,)

§

type V = (<A0 as View>::V,)

source§

fn view(&self) -> (A0::V,)

source§

impl<A0: View, A1: View> View for (A0, A1)

§

type V = (<A0 as View>::V, <A1 as View>::V)

source§

fn view(&self) -> (A0::V, A1::V)

source§

impl<A0: View, A1: View, A2: View> View for (A0, A1, A2)

§

type V = (<A0 as View>::V, <A1 as View>::V, <A2 as View>::V)

source§

fn view(&self) -> (A0::V, A1::V, A2::V)

source§

impl<A0: View, A1: View, A2: View, A3: View> View for (A0, A1, A2, A3)

§

type V = (<A0 as View>::V, <A1 as View>::V, <A2 as View>::V, <A3 as View>::V)

source§

fn view(&self) -> (A0::V, A1::V, A2::V, A3::V)

source§

impl<A: View + ?Sized> View for &A

source§

open spec fn view(&self) -> A::V

{ (**self).view() }
§

type V = <A as View>::V

source§

impl<A: View + ?Sized> View for Box<A>

source§

open spec fn view(&self) -> A::V

{ (**self).view() }
§

type V = <A as View>::V

source§

impl<A: View> View for Rc<A>

source§

open spec fn view(&self) -> A::V

{ (**self).view() }
§

type V = <A as View>::V

source§

impl<A: View> View for Arc<A>

source§

open spec fn view(&self) -> A::V

{ (**self).view() }
§

type V = <A as View>::V

source§

impl<Key, S> View for HashSet<Key, S>

source§

closed spec fn view(&self) -> Set<Key>

§

type V = Set<Key>

source§

impl<Key, Value, S> View for HashMap<Key, Value, S>

source§

closed spec fn view(&self) -> Map<Key, Value>

§

type V = Map<Key, Value>

source§

impl<T> View for [T]

source§

spec fn view(&self) -> Seq<T>

§

type V = Seq<T>

source§

impl<T, A: Allocator> View for Vec<T, A>

source§

spec fn view(&self) -> Seq<T>

§

type V = Seq<T>

source§

impl<T, const N: usize> View for [T; N]

source§

open spec fn view(&self) -> Seq<T>

{ array_view(*self) }
§

type V = Seq<T>

source§

impl<T: ?Sized> View for *const T

source§

open spec fn view(&self) -> Self::V

{ (*self as *mut T).view() }
§

type V = PtrData

source§

impl<T: ?Sized> View for *mut T

source§

spec fn view(&self) -> Self::V

§

type V = PtrData

Implementors§

source§

impl View for StringHashSet

§

type V = Set<Seq<char>>

source§

impl<A: StepSpec + Step> View for RangeGhostIterator<A>

§

type V = Seq<A>

source§

impl<Key> View for HashSetWithView<Key>
where Key: View + Eq + Hash,

§

type V = Set<<Key as View>::V>

source§

impl<Key, Value> View for HashMapWithView<Key, Value>
where Key: View + Eq + Hash,

§

type V = Map<<Key as View>::V, Value>

source§

impl<T> View for PointsTo<T>

§

type V = PointsToData<T>

source§

impl<Value> View for StringHashMap<Value>

§

type V = Map<Seq<char>, Value>