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
impl<'a> FnLikeNode<'a>[src]
impl<'a> FnLikeNode<'a>[src]pub fn from_node(node: Node<'_>) -> Option<FnLikeNode<'_>>[src]
pub fn from_node(node: Node<'_>) -> Option<FnLikeNode<'_>>[src]Attempts to construct a FnLikeNode from presumed FnLike node input.
pub fn body(self) -> BodyId[src]
pub fn decl(self) -> &'a FnDecl<'a>[src]
pub fn span(self) -> Span[src]
pub fn id(self) -> HirId[src]
pub fn constness(self) -> Constness[src]
pub fn asyncness(self) -> IsAsync[src]
pub fn unsafety(self) -> Unsafety[src]
pub fn kind(self) -> FnKind<'a>[src]
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, [src]
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
impl<'a> Clone for FnLikeNode<'a>[src]
impl<'a> Clone for FnLikeNode<'a>[src]fn clone(&self) -> FnLikeNode<'a>[src]
fn clone(&self) -> FnLikeNode<'a>[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl<'a> Debug for FnLikeNode<'a>[src]
impl<'a> Debug for FnLikeNode<'a>[src]impl<'a> Copy for FnLikeNode<'a>[src]
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
impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]
impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]pub fn allocate_on(Self, &'a Arena<'tcx>) -> &'a mut T[src]
pub fn allocate_from_iter(
&'a Arena<'tcx>,
impl IntoIterator<Item = T>
) -> &'a mut [T]ⓘ[src]
&'a Arena<'tcx>,
impl IntoIterator<Item = T>
) -> &'a mut [T]ⓘ
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> MaybeResult<T> for T[src]
impl<T> MaybeResult<T> for T[src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> WithConstness for T[src]
impl<T> WithConstness for T[src]fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]
fn with_const(self) -> ConstnessAnd<Self>[src]
fn without_const(self) -> ConstnessAnd<Self>[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,