pub struct WorkspaceIndexData {
pub files: Vec<(Uri, Arc<FileIndex>)>,
pub classes_by_lowercase_name: Vec<(Box<str>, ClassRef)>,
/* private fields */
}Expand description
Aggregated workspace-level index. Constructed once per salsa revision by
workspace_index and held behind an Arc for cheap cross-request sharing.
Fields§
§files: Vec<(Uri, Arc<FileIndex>)>§classes_by_lowercase_name: Vec<(Box<str>, ClassRef)>One (lowercase_short_name, ClassRef) pair per distinct class name,
sorted by the lowercase key. Built once per revision so completion’s
prefix search can binary-search a range instead of scanning every
class name (and re-lowercasing it) on every keystroke.
Implementations§
Source§impl WorkspaceIndexData
impl WorkspaceIndexData
Sourcepub fn at(&self, r: ClassRef) -> Option<(&Uri, &ClassDef)>
pub fn at(&self, r: ClassRef) -> Option<(&Uri, &ClassDef)>
Resolve a ClassRef back to its (uri, class_def) pair.
Sourcepub fn for_each_class(&self, f: impl FnMut(&Uri, &ClassDef))
pub fn for_each_class(&self, f: impl FnMut(&Uri, &ClassDef))
Visit every class-like declaration stored in the aggregate.
Sourcepub fn for_each_class_in_uris(
&self,
uris: &[Uri],
f: impl FnMut(&Uri, &ClassDef),
)
pub fn for_each_class_in_uris( &self, uris: &[Uri], f: impl FnMut(&Uri, &ClassDef), )
Visit every class-like declaration in the files named by uris.
Missing paths are skipped; callers typically source uris from mir’s
mention or subtype indexes, which are candidate sets rather than proof.
Sourcepub fn from_files(files: Vec<(Uri, Arc<FileIndex>)>) -> Self
pub fn from_files(files: Vec<(Uri, Arc<FileIndex>)>) -> Self
Constructor that builds the reverse maps from an already-materialised
(Uri, Arc<FileIndex>) slice. Exposed so callers that don’t want to
spin up a full AnalysisHost (unit tests of
find_implementations_from_workspace, benchmark crates) can exercise
the aggregate-shaped helpers directly. Production code goes through
the workspace_index salsa query instead.
Auto Trait Implementations§
impl Freeze for WorkspaceIndexData
impl RefUnwindSafe for WorkspaceIndexData
impl Send for WorkspaceIndexData
impl Sync for WorkspaceIndexData
impl Unpin for WorkspaceIndexData
impl UnsafeUnpin for WorkspaceIndexData
impl UnwindSafe for WorkspaceIndexData
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more