pub struct ProjectState { /* private fields */ }Expand description
Discovered files and workspace packages for one analysis run.
The files are indexed by their dense FileId.
Implementations§
Source§impl ProjectState
impl ProjectState
Sourcepub fn new(
files: Vec<DiscoveredFile>,
workspaces: Vec<WorkspaceInfo>,
) -> ProjectState
pub fn new( files: Vec<DiscoveredFile>, workspaces: Vec<WorkspaceInfo>, ) -> ProjectState
Build a new project state from discovered files and workspaces.
Sourcepub fn files(&self) -> &[DiscoveredFile]
pub fn files(&self) -> &[DiscoveredFile]
All discovered files, indexed by FileId.
Sourcepub fn workspaces(&self) -> &[WorkspaceInfo]
pub fn workspaces(&self) -> &[WorkspaceInfo]
All discovered workspace packages.
Sourcepub fn file_by_id(&self, id: FileId) -> Option<&DiscoveredFile>
pub fn file_by_id(&self, id: FileId) -> Option<&DiscoveredFile>
Look up a file by its FileId.
Auto Trait Implementations§
impl Freeze for ProjectState
impl RefUnwindSafe for ProjectState
impl Send for ProjectState
impl Sync for ProjectState
impl Unpin for ProjectState
impl UnsafeUnpin for ProjectState
impl UnwindSafe for ProjectState
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
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> ⓘ
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