pub struct IncludeResolver<'a, F: FileProvider> { /* private fields */ }Expand description
Resolves includes against a provider and a configuration.
Holds a &mut PathInterner because resolving is the moment a file’s identity is decided: the id has to
be minted by whoever keeps the table, and there is no useful resolution that does not produce one.
Implementations§
Source§impl<'a, F: FileProvider> IncludeResolver<'a, F>
impl<'a, F: FileProvider> IncludeResolver<'a, F>
pub fn new(files: &'a F, config: &'a CompilerConfig) -> Self
Sourcepub fn files(&self) -> &'a F
pub fn files(&self) -> &'a F
The provider this resolver reads through.
Exposed for the one caller that has to resolve something an include search cannot: a module partition, whose file is found by the module naming convention rather than by a search path. It needs the same provider and the same configuration, and taking them from here is what keeps one resolver per file rather than two.
Sourcepub fn config(&self) -> &'a CompilerConfig
pub fn config(&self) -> &'a CompilerConfig
The compilation this resolver resolves against.
Sourcepub fn resolve(
&self,
include: &Include,
including: &Path,
origin: Option<&FoundIn>,
interner: &mut PathInterner,
) -> Resolution
pub fn resolve( &self, include: &Include, including: &Path, origin: Option<&FoundIn>, interner: &mut PathInterner, ) -> Resolution
Resolve an include written in the file at including.
including is the directory of the file doing the including, which the caller has because only it
knows how that file was itself found.
Auto Trait Implementations§
impl<'a, F> Forget for IncludeResolver<'a, F>
impl<'a, F> Freeze for IncludeResolver<'a, F>
impl<'a, F> RefUnwindSafe for IncludeResolver<'a, F>where
&'a F: RefUnwindSafe,
impl<'a, F> Send for IncludeResolver<'a, F>
impl<'a, F> Sync for IncludeResolver<'a, F>
impl<'a, F> Unpin for IncludeResolver<'a, F>
impl<'a, F> UnsafeUnpin for IncludeResolver<'a, F>where
&'a F: UnsafeUnpin,
impl<'a, F> UnwindSafe for IncludeResolver<'a, F>where
&'a F: UnwindSafe,
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
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