pub struct ProvenanceMap<Prov = AllocId> {
    ptrs: SortedMap<Size, Prov>,
    bytes: Option<Box<SortedMap<Size, Prov>>>,
}
Expand description

Stores the provenance information of pointers stored in memory.

Fields§

§ptrs: SortedMap<Size, Prov>

Provenance in this map applies from the given offset for an entire pointer-size worth of bytes. Two entires in this map are always at least a pointer size apart.

§bytes: Option<Box<SortedMap<Size, Prov>>>

Provenance in this map only applies to the given single byte. This map is disjoint from the previous. It will always be empty when Prov::OFFSET_IS_ADDR is false.

Implementations§

The caller must guarantee that the given provenance list is already sorted by address and contain no duplicates.

Give access to the ptr-sized provenances (which can also be thought of as relocations, and indeed that is how codegen treats them).

Only exposed with AllocId provenance, since it panics if there is bytewise provenance.

Returns all ptr-sized provenance in the given range. If the range has length 0, returns provenance that crosses the edge between start-1 and start.

Returns all byte-wise provenance in the given range.

Get the provenance of a single byte.

Check if here is ptr-sized provenance at the given index. Does not mean anything for bytewise provenance! But can be useful as an optimization.

Returns whether this allocation has provenance overlapping with the given range.

Note: this function exists to allow range_get_provenance to be private, in order to somewhat limit access to provenance outside of the Allocation abstraction.

Yields all the provenances stored in this map.

Removes all provenance inside the given range. If there is provenance overlapping with the edges, might result in an error.

Applies a provenance copy. The affected range, as defined in the parameters to prepare_copy is expected to be clear of provenance.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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
This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous). Read more
This method tries to recover the query key from the given DepNode, something which is needed when forcing DepNodes during red-green evaluation. The query system will only call this method if fingerprint_style() is not FingerprintStyle::Opaque. It is always valid to return None here, in which case incremental compilation will treat the query as having changed instead of forcing it. 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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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: 32 bytes