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

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

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
Expand description

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)
Expand description

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)
Expand description

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]

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

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

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.