Struct syntax::ast_map::blocks::FnLikeNodeUnstable [-] [+] [src]

pub struct FnLikeNode<'a> {
    // some fields omitted
}

An FnLikeNode is a Node that is like a fn, in that it has a decl and a body (as well as a NodeId, a span, etc).

More specifically, it is one of either: - A function item, - A closure expr (i.e. an ExprClosure), or - The default implementation for a trait method.

To construct one, use the Code::from_node function.

Methods

impl<'a> FnLikeNode<'a>

fn to_fn_parts(self) -> FnParts<'a>

fn body(self) -> &'a Block

fn decl(self) -> &'a FnDecl

fn span(self) -> Span

fn id(self) -> NodeId

fn kind(self) -> FnKind<'a>

Trait Implementations

Derived Implementations

impl<'a> Copy for FnLikeNode<'a>