pub struct Def {
pub params: Vec<Ty>,
pub ret: Ty,
pub effects: BTreeSet<EffectKind>,
pub body: Term,
pub pre: Option<Term>,
pub post: Option<Term>,
}Expand description
One verified unit of Weft: typed parameters, result type, declared effect row, optional contracts, and the body. Its hash is its name.
Fields§
§params: Vec<Ty>§ret: Ty§effects: BTreeSet<EffectKind>Everything this definition (transitively) may construct.
body: Term§pre: Option<Term>Contract: precondition over the parameters (must type as Bool).
post: Option<Term>Contract: postcondition over parameters + result (result = index 0).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Def
impl<'de> Deserialize<'de> for Def
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Def
Auto Trait Implementations§
impl Freeze for Def
impl RefUnwindSafe for Def
impl Send for Def
impl Sync for Def
impl Unpin for Def
impl UnsafeUnpin for Def
impl UnwindSafe for Def
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more