[−][src]Enum rustc_hir::intravisit::NestedVisitorMap

pub enum NestedVisitorMap<M> {
    None,
    OnlyBodies(M),
    All(M),
}

Specifies what nested things a visitor wants to visit. The most common choice is OnlyBodies, which will cause the visitor to visit fn bodies for fns that it encounters, but skip over nested item-like things.

See the comments on ItemLikeVisitor for more details on the overall visit strategy.

Variants

None

Do not visit any nested things. When you add a new "non-nested" thing, you will want to audit such uses to see if they remain valid.

Use this if you are only walking some particular kind of tree (i.e., a type, or fn signature) and you don't want to thread a HIR map around.

OnlyBodies(M)

Do not visit nested item-like things, but visit nested things that are inside of an item-like.

This is the most common choice. A very common pattern is to use visit_all_item_likes() as an outer loop, and to have the visitor that visits the contents of each item using this setting.

All(M)

Visits all nested things, including item-likes.

This is an unusual choice. It is used when you want to process everything within their lexical context. Typically you kick off the visit by doing walk_krate().

Implementations

impl<M> NestedVisitorMap<M>[src]

pub(in intravisit) fn intra(
    self
) -> Option<M>
[src]

Returns the map to use for an "intra item-like" thing (if any). E.g., function body.

pub(in intravisit) fn inter(
    self
) -> Option<M>
[src]

Returns the map to use for an "item-like" thing (if any). E.g., item, impl-item.

Auto Trait Implementations

impl<M> RefUnwindSafe for NestedVisitorMap<M> where
    M: RefUnwindSafe, 

impl<M> Send for NestedVisitorMap<M> where
    M: Send, 

impl<M> Sync for NestedVisitorMap<M> where
    M: Sync, 

impl<M> Unpin for NestedVisitorMap<M> where
    M: Unpin, 

impl<M> UnwindSafe for NestedVisitorMap<M> where
    M: UnwindSafe, 

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.