pub struct AssocFn<'tcx> {
def_id: DefId,
args: Option<GenericArgsRef<'tcx>>,
rustc_sig: PolyFnSig<'tcx>,
param_env: ParamEnv<'tcx>,
associated_item: AssocItem<'tcx>,
inline: InlineAttr,
sig: PolyFnSig<'tcx>,
fn_trait_impls: OnceCell<Option<FnTraitImpls<'tcx>>>,
}Expand description
Associated function: impl MyStruct { fn associated() {} } or trait Foo { fn associated() {} }
Fields§
§def_id: DefId§args: Option<GenericArgsRef<'tcx>>§rustc_sig: PolyFnSig<'tcx>The signature, instantiated with args if relevant.
param_env: ParamEnv<'tcx>§associated_item: AssocItem<'tcx>§inline: InlineAttr§sig: PolyFnSig<'tcx>§fn_trait_impls: OnceCell<Option<FnTraitImpls<'tcx>>>Computed on demand, see AssocFn::fn_trait_impls.
Implementations§
Source§impl<'tcx> AssocFn<'tcx>
impl<'tcx> AssocFn<'tcx>
pub fn param_env(&self) -> &ParamEnv<'tcx>
pub fn associated_item(&self) -> &AssocItem<'tcx>
pub fn inline(&self) -> &InlineAttr
Sourcepub fn vtable_sig(&self, s: &impl BaseState<'tcx>) -> Option<PolyFnSig<'tcx>>
pub fn vtable_sig(&self, s: &impl BaseState<'tcx>) -> Option<PolyFnSig<'tcx>>
The function signature when this method is used in a vtable. None if this method is not
vtable safe. Some(sig) if it is vtable safe, where sig is the trait method declaration’s
signature with Self replaced by dyn Trait and associated types normalized.
Sourcepub fn vtable_receiver_path(&self, s: &impl BaseState<'tcx>) -> Vec<FieldIdx>
pub fn vtable_receiver_path(&self, s: &impl BaseState<'tcx>) -> Vec<FieldIdx>
For a vtable-safe method, the fields to follow from its vtable receiver to the built-in pointer that carries the vtable.
pub fn sig(&self) -> &PolyFnSig<'tcx>
Sourcepub fn fn_trait_impls(
&self,
s: &impl BaseState<'tcx>,
) -> Option<&FnTraitImpls<'tcx>>
pub fn fn_trait_impls( &self, s: &impl BaseState<'tcx>, ) -> Option<&FnTraitImpls<'tcx>>
The virtual Fn* impls for this function, if it is Fn*-compatible.
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> !DynSync for AssocFn<'tcx>
impl<'tcx> !Freeze for AssocFn<'tcx>
impl<'tcx> !RefUnwindSafe for AssocFn<'tcx>
impl<'tcx> !Sync for AssocFn<'tcx>
impl<'tcx> !UnwindSafe for AssocFn<'tcx>
impl<'tcx> DynSend for AssocFn<'tcx>
impl<'tcx> Send for AssocFn<'tcx>
impl<'tcx> Unpin for AssocFn<'tcx>
impl<'tcx> UnsafeUnpin for AssocFn<'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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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