[−][src]Struct rustc_middle::hir::map::blocks::FnLikeNode
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]
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]
pub(in hir::map::blocks) 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 [Attribute]) -> A,
C: FnOnce(ClosureParts<'a>) -> A, [src]
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 [Attribute]) -> A,
C: FnOnce(ClosureParts<'a>) -> A,
Trait Implementations
impl<'a> Clone for FnLikeNode<'a>[src]
pub fn clone(&self) -> FnLikeNode<'a>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<'a> Copy for FnLikeNode<'a>[src]
impl<'a> Debug 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<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]
T: Copy,
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> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> MaybeResult<T> for T[src]
type Error = !
pub fn from(Result<T, <T as MaybeResult<T>>::Error>) -> T[src]
pub fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.