Struct rustc_middle::hir::map::blocks::FnLikeNode [−][src]
pub struct FnLikeNode<'a> {
node: Node<'a>,
}
Expand description
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 ExprKind::Closure), or
- The default implementation for a trait method.
To construct one, use the Code::from_node
function.
Fields
node: Node<'a>
Implementations
Attempts to construct a FnLikeNode from presumed FnLike node input.
fn handle<A, I, M, C>(self, item_fn: I, method: M, closure: C) -> A where
I: FnOnce(ItemFnParts<'a>) -> A,
M: FnOnce(HirId, Ident, &'a FnSig<'a>, Option<&'a Visibility<'a>>, BodyId, Span) -> A,
C: FnOnce(ClosureParts<'a>) -> A,
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for FnLikeNode<'a>
impl<'a> !Send for FnLikeNode<'a>
impl<'a> !Sync for FnLikeNode<'a>
impl<'a> Unpin for FnLikeNode<'a>
impl<'a> !UnwindSafe for FnLikeNode<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes