pub struct FunctionDef {
pub name: String,
pub name_span: Span,
pub declaring_module_path: Option<String>,
pub doc_comment: Option<DocComment>,
pub type_params: Option<Vec<TypeParam>>,
pub params: Vec<FunctionParameter>,
pub return_type: Option<TypeAnnotation>,
pub where_clause: Option<Vec<WherePredicate>>,
pub body: Vec<Statement>,
pub annotations: Vec<Annotation>,
pub is_async: bool,
pub is_comptime: bool,
}Fields§
§name: String§name_span: Span§declaring_module_path: Option<String>Declaring module path for compiler/runtime provenance checks.
This is injected by the module loader for loaded modules and is not part of user-authored source syntax.
doc_comment: Option<DocComment>§type_params: Option<Vec<TypeParam>>§params: Vec<FunctionParameter>§return_type: Option<TypeAnnotation>§where_clause: Option<Vec<WherePredicate>>§body: Vec<Statement>§annotations: Vec<Annotation>§is_async: bool§is_comptime: boolWhether this function is compile-time-only (comptime fn).
Comptime-only functions can only be called from comptime contexts.
Trait Implementations§
Source§impl Clone for FunctionDef
impl Clone for FunctionDef
Source§fn clone(&self) -> FunctionDef
fn clone(&self) -> FunctionDef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FunctionDef
impl Debug for FunctionDef
Source§impl<'de> Deserialize<'de> for FunctionDef
impl<'de> Deserialize<'de> for FunctionDef
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
Source§impl PartialEq for FunctionDef
impl PartialEq for FunctionDef
Source§impl Serialize for FunctionDef
impl Serialize for FunctionDef
impl StructuralPartialEq for FunctionDef
Auto Trait Implementations§
impl Freeze for FunctionDef
impl RefUnwindSafe for FunctionDef
impl Send for FunctionDef
impl Sync for FunctionDef
impl Unpin for FunctionDef
impl UnsafeUnpin for FunctionDef
impl UnwindSafe for FunctionDef
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