Struct uvls::core::cache::FileSystem
source · pub struct FileSystem {
graph: DiGraph<FSNode, FSEdge>,
file2node: HashMap<FileID, NodeIndex>,
}
Expand description
Simple virtual filesystem for fast completions, resolve and namespaces
Fields§
§graph: DiGraph<FSNode, FSEdge>
§file2node: HashMap<FileID, NodeIndex>
Implementations§
source§impl FileSystem
impl FileSystem
fn goto_dir( graph: &DiGraph<FSNode, FSEdge>, root: NodeIndex, path: &[Ustr], ) -> Option<NodeIndex>
fn goto_file( graph: &DiGraph<FSNode, FSEdge>, root: NodeIndex, path: &[Ustr], ) -> Option<NodeIndex>
fn new( files: &HashMap<FileID, Arc<AstDocument>>, errors: &mut ErrorsAcc<'_>, ) -> Self
sourcepub fn imports_connecting(
&self,
a: FileID,
b: FileID,
) -> impl Iterator<Item = Symbol> + '_
pub fn imports_connecting( &self, a: FileID, b: FileID, ) -> impl Iterator<Item = Symbol> + '_
Check an import between a and b
sourcepub fn imports(&self, a: FileID) -> impl Iterator<Item = (Symbol, FileID)> + '_
pub fn imports(&self, a: FileID) -> impl Iterator<Item = (Symbol, FileID)> + '_
all imports from a
pub fn recursive_imports(&self, src: FileID) -> Vec<FileID>
pub fn recursive_imported(&self, src: FileID) -> Vec<FileID>
pub fn resolve_abs(&self, path: &[Ustr]) -> Option<FileID>
pub fn resolve_abs_dir(&self, path: &[Ustr]) -> Option<NodeIndex>
sourcepub fn imported(&self, a: FileID) -> impl Iterator<Item = (Symbol, FileID)> + '_
pub fn imported(&self, a: FileID) -> impl Iterator<Item = (Symbol, FileID)> + '_
all imports to a
sourcepub fn resolve(&self, origin: FileID, path: &[Ustr]) -> Option<FileID>
pub fn resolve(&self, origin: FileID, path: &[Ustr]) -> Option<FileID>
find a file under path from origin
pub fn dir_files<'a>( &'a self, dir: NodeIndex, path: &[Ustr], ) -> impl Iterator<Item = (CompactString, Ustr, FSNode)> + 'a
pub fn dir_of(&self, file: FileID) -> NodeIndex
Trait Implementations§
source§impl Clone for FileSystem
impl Clone for FileSystem
source§fn clone(&self) -> FileSystem
fn clone(&self) -> FileSystem
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FileSystem
impl Debug for FileSystem
source§impl Default for FileSystem
impl Default for FileSystem
source§fn default() -> FileSystem
fn default() -> FileSystem
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FileSystem
impl RefUnwindSafe for FileSystem
impl Send for FileSystem
impl Sync for FileSystem
impl Unpin for FileSystem
impl UnwindSafe for FileSystem
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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