pub struct Function {
pub docs: Vec<Spanned<String>>,
pub attrs: Vec<Attribute>,
pub vis: Visibility,
pub is_async: bool,
pub name: Spanned<String>,
pub generics: Vec<TypeParam>,
pub params: Vec<Param>,
pub return_ty: Option<Spanned<Type>>,
pub where_clause: Vec<WhereBound>,
pub body: Spanned<Block>,
}Expand description
A function or method declaration.
Fields§
§docs: Vec<Spanned<String>>The /// lines before it, one entry per line, holding the text after
the /// (spec
docs/superpowers/specs/2026-10-07-phase-3-1-formatter-design.md §4).
attrs: Vec<Attribute>§vis: Visibility§is_async: bool§name: Spanned<String>§generics: Vec<TypeParam>§params: Vec<Param>§return_ty: Option<Spanned<Type>>§where_clause: Vec<WhereBound>§body: Spanned<Block>Trait Implementations§
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