pub struct ReferenceIndex { /* private fields */ }Expand description
The references of one load, interned, with lookups by target and by holder; see the module documentation for what is a reference.
Every reference is kept once. ReferenceIndex::iter and
ReferenceIndex::to give references grouped by target, targets in
a fixed order (by kind, then by their identities’ bytes), and within a
target in source order: by file path, then by span. ReferenceIndex::from
gives a holder’s references in source order. Both lookups are binary
searches, so their cost does not grow with the references they skip.
Implementations§
Source§impl ReferenceIndex
impl ReferenceIndex
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = Reference<'_>> + '_
pub fn iter(&self) -> impl ExactSizeIterator<Item = Reference<'_>> + '_
Every reference, grouped by target, each group in source order.
Sourcepub fn to(
&self,
target: Target<'_>,
) -> impl ExactSizeIterator<Item = Reference<'_>> + '_
pub fn to( &self, target: Target<'_>, ) -> impl ExactSizeIterator<Item = Reference<'_>> + '_
The references to target, in source order: none when nothing
names it, or when it does not exist.
Sourcepub fn from(
&self,
holder: Holder<'_>,
) -> impl ExactSizeIterator<Item = Reference<'_>> + '_
pub fn from( &self, holder: Holder<'_>, ) -> impl ExactSizeIterator<Item = Reference<'_>> + '_
The references holder holds, in source order. An object’s are
its own, not its inventory’s; a chunk’s are its palettes’, not its
objects’.