pub struct Function {
pub attrs: Vec<Attribute>,
pub name: Ident,
pub is_pub: bool,
pub self_mode: SelfMode,
pub self_span: Option<Span>,
pub params: Vec<Param>,
pub return_type: Option<TypeExpr>,
pub body: Block,
pub span: Span,
}Expand description
fn name(params) -> ReturnType { body }, optionally pub. Inside an
impl block the parameter list may start with a self receiver
(self_mode), which is never a Param (spec 2.5).
Fields§
§attrs: Vec<Attribute>§name: Ident§is_pub: bool§self_mode: SelfMode§self_span: Option<Span>The self keyword of the receiver, where a mut fix-it inserts;
None exactly when self_mode is SelfMode::None.
params: Vec<Param>§return_type: Option<TypeExpr>§body: Block§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 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