pub struct TraitImpl<'tcx> {
this: ItemRef<'tcx>,
args: Option<GenericArgsRef<'tcx>>,
trait_ref: TraitRef<'tcx>,
param_env: ParamEnv<'tcx>,
trait_pred: TraitPredicate<'tcx>,
is_unsafe: bool,
implied_trait_proofs: Vec<TraitProof<'tcx>>,
items: OnceCell<Vec<ImplAssocItem<'tcx>>>,
}Fields§
§this: ItemRef<'tcx>§args: Option<GenericArgsRef<'tcx>>§trait_ref: TraitRef<'tcx>The implemented trait, instantiated with args if relevant.
param_env: ParamEnv<'tcx>§trait_pred: TraitPredicate<'tcx>The trait that is implemented by this impl block.
is_unsafe: bool§implied_trait_proofs: Vec<TraitProof<'tcx>>The trait proofs required to satisfy the predicates on the trait declaration. E.g.:
ⓘ
trait Foo: Bar {}
impl Foo for () {} // would supply a proof for `Self: Bar`.items: OnceCell<Vec<ImplAssocItem<'tcx>>>Computed on demand, see TraitImpl::items.
Implementations§
Source§impl<'tcx> TraitImpl<'tcx>
impl<'tcx> TraitImpl<'tcx>
pub fn param_env(&self) -> &ParamEnv<'tcx>
Sourcepub fn trait_pred(&self) -> &TraitPredicate<'tcx>
pub fn trait_pred(&self) -> &TraitPredicate<'tcx>
The trait that is implemented by this impl block.
Sourcepub fn dyn_self(&self, s: &impl BaseState<'tcx>) -> Option<Ty<'tcx>>
pub fn dyn_self(&self, s: &impl BaseState<'tcx>) -> Option<Ty<'tcx>>
dyn Trait<Args.., Ty = <Self as Trait>::Ty..> for the implemented trait. This is
Some iff the trait is dyn-compatible.
Sourcepub fn implied_trait_proofs(&self) -> &[TraitProof<'tcx>]
pub fn implied_trait_proofs(&self) -> &[TraitProof<'tcx>]
The trait proofs required to satisfy the predicates on the trait declaration. E.g.:
ⓘ
trait Foo: Bar {}
impl Foo for () {} // would supply a proof for `Self: Bar`.Sourcepub fn items(&self, s: &impl BaseState<'tcx>) -> &[ImplAssocItem<'tcx>]
pub fn items(&self, s: &impl BaseState<'tcx>) -> &[ImplAssocItem<'tcx>]
Associated items, in the order of the trait declaration. Includes defaulted items.
fn compute_items(&self, s: &impl BaseState<'tcx>) -> Vec<ImplAssocItem<'tcx>>
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> !DynSync for TraitImpl<'tcx>
impl<'tcx> !Freeze for TraitImpl<'tcx>
impl<'tcx> !RefUnwindSafe for TraitImpl<'tcx>
impl<'tcx> !Sync for TraitImpl<'tcx>
impl<'tcx> !UnwindSafe for TraitImpl<'tcx>
impl<'tcx> DynSend for TraitImpl<'tcx>
impl<'tcx> Send for TraitImpl<'tcx>
impl<'tcx> Unpin for TraitImpl<'tcx>
impl<'tcx> UnsafeUnpin for TraitImpl<'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