pub(crate) struct Index {
symbols: Vec<Symbol>,
occurrences: Vec<Occurrence>,
}Fields§
§symbols: Vec<Symbol>§occurrences: Vec<Occurrence>Sorted by file, then position. Names never overlap, so within a file this is also sorted by end.
Implementations§
Source§impl Index
impl Index
Sourcepub(crate) fn new(files: &[&File]) -> Self
pub(crate) fn new(files: &[&File]) -> Self
Indexes files as one program, which share their top-level names.
pub(crate) fn symbol(&self, id: SymbolId) -> &Symbol
Sourcepub(crate) fn occurrences_in(&self, file: FileId) -> &[Occurrence]
pub(crate) fn occurrences_in(&self, file: FileId) -> &[Occurrence]
The names in file, in source order.
Sourcepub(crate) fn occurrence_at(
&self,
file: FileId,
offset: usize,
) -> Option<Occurrence>
pub(crate) fn occurrence_at( &self, file: FileId, offset: usize, ) -> Option<Occurrence>
The name covering offset in file, including a cursor sitting just past its last
character.
Sourcepub(crate) fn occurrences_of(
&self,
id: SymbolId,
) -> impl Iterator<Item = Occurrence>
pub(crate) fn occurrences_of( &self, id: SymbolId, ) -> impl Iterator<Item = Occurrence>
The declaration and every reference of id, file by file in source order.
Sourcepub(crate) fn in_scope(
&self,
file: FileId,
offset: usize,
) -> impl Iterator<Item = &Symbol>
pub(crate) fn in_scope( &self, file: FileId, offset: usize, ) -> impl Iterator<Item = &Symbol>
The symbols whose names can be used at offset in file. Fields are only reached
through a value or an argument label, so they are never in scope by themselves.
pub(crate) fn declaration_of(&self, id: SymbolId) -> Option<Span>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnsafeUnpin for Index
impl UnwindSafe for Index
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more