pub struct Function {Show 14 fields
pub visibility: Visibility,
pub name: Ident,
pub generics: GenericParams,
pub params: Vec<Param>,
pub return_type: Option<Type>,
pub where_clause: WhereClause,
pub body: Option<Block>,
pub is_extern: bool,
pub is_async: bool,
pub is_const: bool,
pub attributes: Vec<Attribute>,
pub energy_budget: Option<EnergyBudget>,
pub proc_macro_kind: Option<ProcMacroKind>,
pub span: Span,
}Expand description
Function definition
Fields§
§visibility: Visibility§name: Ident§generics: GenericParams§params: Vec<Param>§return_type: Option<Type>§where_clause: WhereClause§body: Option<Block>Body is None for extern function declarations
is_extern: boolWhether this is an extern function
is_async: boolWhether this is an async function (async fn)
is_const: boolWhether this is a const function (const fn)
attributes: Vec<Attribute>Attributes attached to this function (e.g., #[energy_budget(...)])
energy_budget: Option<EnergyBudget>Parsed energy budget constraint from #[energy_budget(...)] attribute
proc_macro_kind: Option<ProcMacroKind>Procedural macro kind (if this function is a proc macro)
span: SpanTrait Implementations§
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 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