Enum syntax::ast_map::blocks::CodeUnstable [-] [+] [src]

pub enum Code<'a> {
    FnLikeCode(FnLikeNode<'a>),
    BlockCode(&'a Block),
}

Carries either an FnLikeNode or a Block, as these are the two constructs that correspond to "code" (as in, something from which we can construct a control-flow graph).

Variants

FnLikeCode
BlockCode

Methods

impl<'a> Code<'a>

fn id(&self) -> NodeId

fn from_node(node: Node) -> Option<Code>

Attempts to construct a Code from presumed FnLike or Block node input.

Trait Implementations

Derived Implementations

impl<'a> Copy for Code<'a>