pub enum ResolutionContext {
Disabled,
Enabled {
resolver: Arc<dyn Resolver>,
consumer_module: Module,
},
}Expand description
The context required to resolve symbolic module imports during analysis.
This is an either/or by construction. Resolution is either
Disabled, in which case symbolic imports do
not resolve, or Enabled, which always pairs
a resolver with the consumer module it resolves imports for. The pairing is
kept in one variant so a resolver can never exist without a module, nor a
module without a resolver.
Variants§
Disabled
Module resolution is disabled; symbolic imports do not resolve.
Enabled
Module resolution is enabled for a consumer module.
Fields
Implementations§
Source§impl ResolutionContext
impl ResolutionContext
Sourcepub fn enabled(resolver: Arc<dyn Resolver>, consumer_module: Module) -> Self
pub fn enabled(resolver: Arc<dyn Resolver>, consumer_module: Module) -> Self
Creates a resolution context that resolves symbolic imports for the given consumer module through the given resolver.
Sourcepub fn module_root(&self) -> Option<&Path>
pub fn module_root(&self) -> Option<&Path>
Returns the root directory of the consumer module governing analysis, if resolution is enabled.
Trait Implementations§
Source§impl Clone for ResolutionContext
impl Clone for ResolutionContext
Source§fn clone(&self) -> ResolutionContext
fn clone(&self) -> ResolutionContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ResolutionContext
impl Debug for ResolutionContext
Source§impl Default for ResolutionContext
impl Default for ResolutionContext
Source§fn default() -> ResolutionContext
fn default() -> ResolutionContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ResolutionContext
impl !UnwindSafe for ResolutionContext
impl Freeze for ResolutionContext
impl Send for ResolutionContext
impl Sync for ResolutionContext
impl Unpin for ResolutionContext
impl UnsafeUnpin for ResolutionContext
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§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