pub trait Repr<R: Sized>: Sized {
// Required methods
spec fn wf(r: R) -> bool;
spec fn from_repr_spec(r: R) -> Self;
exec fn to_repr(self) -> res : R;
exec fn from_borrowed<'a>(r: &'a R) -> res : &'a Self;
exec fn from_borrowed_mut<'a>(r: &'a mut R) -> res : &'a mut Self;
}Expand description
A trait for types that have a concrete representation type R.
Required Methods§
Sourcespec fn from_repr_spec(r: R) -> Self
spec fn from_repr_spec(r: R) -> Self
Sourceexec fn from_borrowed<'a>(r: &'a R) -> res : &'a Self
exec fn from_borrowed<'a>(r: &'a R) -> res : &'a Self
requires
Self::wf(*r),ensures*res == Self::from_repr_spec(*r),Sourceexec fn from_borrowed_mut<'a>(r: &'a mut R) -> res : &'a mut Self
exec fn from_borrowed_mut<'a>(r: &'a mut R) -> res : &'a mut Self
requires
Self::wf(*old(r)),ensures*res == Self::from_repr_spec(*old(r)),Self::wf(*final(r)),*final(res) == Self::from_repr_spec(*final(r)),Mutable projection of the representation. Implementations must keep the representation consistent with mutations through the returned reference.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".