pub enum Stub {
SubClosure {
generic_name: String,
},
SubFuture {
generic_name: String,
},
}
Variants§
SubClosure
Replaces the result of a call to a higher-order function with a call to the input closure.
SubFuture
Replaces the result of a higher-order future by an input future.
Implementations§
Source§impl Stub
impl Stub
pub fn resolve_alternate_instance<'tcx>( &self, tcx: TyCtxt<'tcx>, function: Instance<'tcx>, param_env: TypingEnv<'tcx>, at: RustSpan, ) -> Result<Instance<'tcx>, ErrorGuaranteed>
fn indirect_required( &self, tcx: TyCtxt<'_>, def_id: DefId, at: RustSpan, ) -> Result<bool, ErrorGuaranteed>
Sourcepub fn apply<'tcx>(
&self,
tcx: TyCtxt<'tcx>,
function: Instance<'tcx>,
param_env: TypingEnv<'tcx>,
arguments: ArgSlice<'_, 'tcx>,
at: RustSpan,
) -> Result<(Instance<'tcx>, CallingConvention<'tcx>), ErrorGuaranteed>
pub fn apply<'tcx>( &self, tcx: TyCtxt<'tcx>, function: Instance<'tcx>, param_env: TypingEnv<'tcx>, arguments: ArgSlice<'_, 'tcx>, at: RustSpan, ) -> Result<(Instance<'tcx>, CallingConvention<'tcx>), ErrorGuaranteed>
Performs the effects of this model on the provided function.
function
is what was to be called but for which a stub exists,
arguments
are the arguments to that call.
Returns a new instance to call instead and how it should be called.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stub
impl<'de> Deserialize<'de> for Stub
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Stub
impl RefUnwindSafe for Stub
impl Send for Stub
impl Sync for Stub
impl Unpin for Stub
impl UnwindSafe for Stub
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> 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