pub struct Function {
pub name: Identifier,
pub generics: Vec<GenericParam>,
pub params: Vec<Param>,
pub return_type: Option<Type>,
pub body: Option<Block>,
pub annotations: Vec<Attribute>,
pub span: Span,
pub is_abstract: bool,
pub is_final: bool,
}Expand description
A function definition
Fields§
§name: IdentifierThe function name.
generics: Vec<GenericParam>Generic parameters for the function.
params: Vec<Param>The function parameters.
return_type: Option<Type>Optional return type annotation.
body: Option<Block>The optional function body.
annotations: Vec<Attribute>Annotations applied to the function.
span: SpanThe source code span.
is_abstract: boolWhether this function is abstract (has no body implementation).
is_final: boolWhether this function is final (cannot be overridden).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
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 Eq for Function
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
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