pub trait Consistency {
type Val;
// Required method
spec fn consistent(&self, v: Self::Val) -> bool;
}Expand description
Value well-formedness according to a format’s specification.
§Examples
crate::combinators::Refinedrequires the refinement predicate;crate::combinators::Varied/crate::combinators::Repeatrequires matching length/count;crate::combinators::U8imposes trivial consistency condition (allu8values are consistent with the format);crate::combinators::Voidis uninhabited and thus has no consistent values.
Required Associated Types§
Required Methods§
Sourcespec fn consistent(&self, v: Self::Val) -> bool
spec fn consistent(&self, v: Self::Val) -> bool
Returns true if v is well-formed w.r.t. this combinator.
Implementations on Foreign Types§
Source§impl<S: Consistency> Consistency for &S
impl<S: Consistency> Consistency for &S
Source§open spec fn consistent(&self, v: Self::Val) -> bool
open spec fn consistent(&self, v: Self::Val) -> bool
{ (*self).consistent(v) }