pub enum TraitItem {
Method {
name: Ident,
generic_parameters: Option<Vec<GenericParam>>,
self_type: TypeOfSelf,
other_parameters: Vec<FnArg>,
return_type: Option<Type>,
handler: Box<dyn for<'a> Fn(Item<'a>) -> Result<Vec<Stmt>, Box<dyn Error>>>,
},
AssociatedFunction {
name: Ident,
generic_parameters: Option<Vec<GenericParam>>,
parameters: Vec<FnArg>,
return_type: Option<Type>,
handler: Box<dyn for<'a> Fn(&'a mut Structure) -> Result<Vec<Stmt>, Box<dyn Error>>>,
},
}
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.