pub struct CallStringResolver<'tcx> {
cache: Cache<CallString, Instance<'tcx>>,
ctx: Pctx<'tcx>,
entrypoint_is_async: bool,
}
Expand description
Cached resolution of CallString
s to Instance
s.
Only valid for a single controller. Each controller should initialize a new resolver.
Fields§
§cache: Cache<CallString, Instance<'tcx>>
§ctx: Pctx<'tcx>
§entrypoint_is_async: bool
Implementations§
Source§impl<'tcx> CallStringResolver<'tcx>
impl<'tcx> CallStringResolver<'tcx>
Sourcepub fn resolve(&self, cs: CallString) -> Instance<'tcx>
pub fn resolve(&self, cs: CallString) -> Instance<'tcx>
Tries to resolve to the monomophized function in which this call
site exists. That is to say that return.def_id() == cs.leaf().function
.
Unlike Self::resolve_internal
this can be called on any valid
CallString
.
pub fn new(ctx: Pctx<'tcx>, entrypoint: Endpoint) -> Self
Sourcefn resolve_internal(&self, cs: CallString) -> Instance<'tcx>
fn resolve_internal(&self, cs: CallString) -> Instance<'tcx>
This resolves the monomorphized function being called at this call site.
This function is internal because it panics if cs.leaf().location
is not either a function call or a statement where an async closure
is created and assigned.
Auto Trait Implementations§
impl<'tcx> !Freeze for CallStringResolver<'tcx>
impl<'tcx> !RefUnwindSafe for CallStringResolver<'tcx>
impl<'tcx> !Send for CallStringResolver<'tcx>
impl<'tcx> !Sync for CallStringResolver<'tcx>
impl<'tcx> Unpin for CallStringResolver<'tcx>
impl<'tcx> !UnwindSafe for CallStringResolver<'tcx>
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<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
Source§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
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 moreSource§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
Source§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more