pub struct FnDecl {
pub name: String,
pub type_params: Vec<String>,
pub params: Vec<Param>,
pub effects: Vec<Effect>,
pub return_type: TypeExpr,
pub body: Block,
pub examples: Vec<Example>,
}Fields§
§name: String§type_params: Vec<String>§params: Vec<Param>§effects: Vec<Effect>§return_type: TypeExpr§body: Block§examples: Vec<Example>Optional examples { call(a, b) => expected, ... } block (#369).
Each case binds the function on literal-or-pure arguments and
declares the value the body is expected to produce. Pure-only in
v1: a function carrying examples must declare no effects.
Serialized as an empty Vec so the JSON shape stays compatible
with pre-#369 signatures when the block is absent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FnDecl
impl<'de> Deserialize<'de> for FnDecl
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 FnDecl
Auto Trait Implementations§
impl Freeze for FnDecl
impl RefUnwindSafe for FnDecl
impl Send for FnDecl
impl Sync for FnDecl
impl Unpin for FnDecl
impl UnsafeUnpin for FnDecl
impl UnwindSafe for FnDecl
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