pub struct Map {
    locals: IndexVec<Local, Option<PlaceIndex>>,
    projections: FxHashMap<(PlaceIndex, TrackElem), PlaceIndex>,
    places: IndexVec<PlaceIndex, PlaceInfo>,
    value_count: usize,
}
Expand description

Partial mapping from Place to PlaceIndex, where some places also have a ValueIndex.

This data structure essentially maintains a tree of places and their projections. Some additional bookkeeping is done, to speed up traversal over this tree:

  • For iteration, every PlaceInfo contains an intrusive linked list of its children.
  • To directly get the child for a specific projection, there is a projections map.

Fields§

§locals: IndexVec<Local, Option<PlaceIndex>>§projections: FxHashMap<(PlaceIndex, TrackElem), PlaceIndex>§places: IndexVec<PlaceIndex, PlaceInfo>§value_count: usize

Implementations§

Returns a map that only tracks places whose type passes the filter.

This is currently the only way to create a Map. The way in which the tracked places are chosen is an implementation detail and may not be relied upon (other than that their type passes the filter).

Register all non-excluded places that pass the filter.

Potentially register the (local, projection) place and its fields, recursively.

Invariant: The projection must only contain fields.

Tries to add the place to the map, without allocating a value slot.

Can fail if the projection contains non-trackable elements.

Returns the number of tracked places, i.e., those for which a value can be stored.

Applies a single projection element, yielding the corresponding child.

Locates the given place, if it exists in the tree.

Iterate over all direct children.

Invoke a function on the given place and all descendants.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

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: 88 bytes