pub(crate) struct GlobalStateSnapshot {
pub(crate) config: Arc<Config>,
pub(crate) analysis: Analysis,
pub(crate) check_fixes: Arc<Vec<FxHashMap<Option<PackageSpecifier>, FxHashMap<FileId, Vec<Fix>>>>>,
mem_docs: MemDocs,
pub(crate) semantic_tokens_cache: Arc<Mutex<FxHashMap<Url, SemanticTokens>>>,
vfs: Arc<RwLock<(Vfs, FxHashMap<FileId, LineEndings>)>>,
pub(crate) workspaces: Arc<Vec<ProjectWorkspace>>,
pub(crate) proc_macros_loaded: bool,
pub(crate) flycheck: Arc<[FlycheckHandle]>,
minicore: MiniCoreRustAnalyzerInternalOnly,
}Expand description
An immutable snapshot of the world’s state at a point in time.
Fields§
§config: Arc<Config>§analysis: Analysis§check_fixes: Arc<Vec<FxHashMap<Option<PackageSpecifier>, FxHashMap<FileId, Vec<Fix>>>>>§mem_docs: MemDocs§semantic_tokens_cache: Arc<Mutex<FxHashMap<Url, SemanticTokens>>>§vfs: Arc<RwLock<(Vfs, FxHashMap<FileId, LineEndings>)>>§workspaces: Arc<Vec<ProjectWorkspace>>§proc_macros_loaded: bool§flycheck: Arc<[FlycheckHandle]>§minicore: MiniCoreRustAnalyzerInternalOnlyImplementations§
Source§impl GlobalStateSnapshot
impl GlobalStateSnapshot
fn vfs_read(&self) -> MappedRwLockReadGuard<'_, Vfs>
Sourcepub(crate) fn url_to_file_id(&self, url: &Url) -> Result<Option<FileId>>
pub(crate) fn url_to_file_id(&self, url: &Url) -> Result<Option<FileId>>
Returns None if the file was excluded.
pub(crate) fn file_id_to_url(&self, id: FileId) -> Url
Sourcepub(crate) fn vfs_path_to_file_id(
&self,
vfs_path: &VfsPath,
) -> Result<Option<FileId>>
pub(crate) fn vfs_path_to_file_id( &self, vfs_path: &VfsPath, ) -> Result<Option<FileId>>
Returns None if the file was excluded.
pub(crate) fn file_line_index(&self, file_id: FileId) -> Cancellable<LineIndex>
pub(crate) fn file_version(&self, file_id: FileId) -> Option<i32>
pub(crate) fn url_file_version(&self, url: &Url) -> Option<i32>
pub(crate) fn anchored_path(&self, path: &AnchoredPathBuf) -> Url
pub(crate) fn file_id_to_file_path(&self, file_id: FileId) -> VfsPath
pub(crate) fn target_spec_for_crate( &self, crate_id: Crate, ) -> Option<TargetSpec>
pub(crate) fn target_spec_for_file( &self, file_id: FileId, crate_id: Crate, ) -> Option<TargetSpec>
pub(crate) fn all_workspace_dependencies_for_package( &self, package: &PackageSpecifier, ) -> Option<FxHashSet<PackageSpecifier>>
pub(crate) fn file_exists(&self, file_id: FileId) -> bool
pub(crate) fn minicore(&self) -> MiniCore<'_>
Trait Implementations§
impl UnwindSafe for GlobalStateSnapshot
Auto Trait Implementations§
impl !Freeze for GlobalStateSnapshot
impl !RefUnwindSafe for GlobalStateSnapshot
impl Send for GlobalStateSnapshot
impl !Sync for GlobalStateSnapshot
impl Unpin for GlobalStateSnapshot
impl UnsafeUnpin for GlobalStateSnapshot
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
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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