pub struct Trait<'tcx> {
def_id: DefId,
args: Option<GenericArgsRef<'tcx>>,
param_env: ParamEnv<'tcx>,
implied_predicates: GenericPredicates<'tcx>,
is_unsafe: bool,
self_predicate: TraitPredicate<'tcx>,
dyn_self: Option<Ty<'tcx>>,
implied_trait_proofs: OnceCell<Vec<TraitProof<'tcx>>>,
items: OnceCell<Vec<AssocItem<'tcx>>>,
}Fields§
§def_id: DefId§args: Option<GenericArgsRef<'tcx>>§param_env: ParamEnv<'tcx>§implied_predicates: GenericPredicates<'tcx>§is_unsafe: bool§self_predicate: TraitPredicate<'tcx>The special Self: Trait clause.
dyn_self: Option<Ty<'tcx>>dyn Trait<Args.., Ty = <Self as Trait>::Ty..> for this trait. This is Some iff this
trait is dyn-compatible.
implied_trait_proofs: OnceCell<Vec<TraitProof<'tcx>>>Computed on demand, see Trait::implied_trait_proofs.
items: OnceCell<Vec<AssocItem<'tcx>>>Computed on demand, see Trait::items.
Implementations§
Source§impl<'tcx> Trait<'tcx>
impl<'tcx> Trait<'tcx>
pub fn param_env(&self) -> &ParamEnv<'tcx>
pub fn implied_predicates(&self) -> &GenericPredicates<'tcx>
Sourcepub fn implied_trait_proofs(
&self,
s: &impl BaseState<'tcx>,
) -> &[TraitProof<'tcx>]
pub fn implied_trait_proofs( &self, s: &impl BaseState<'tcx>, ) -> &[TraitProof<'tcx>]
Proofs of the implied predicates. Most often uses the Self clause, except for builtin
traits like Sized.
Sourcepub fn self_predicate(&self) -> &TraitPredicate<'tcx>
pub fn self_predicate(&self) -> &TraitPredicate<'tcx>
The special Self: Trait clause.
Sourcepub fn items(&self, s: &impl BaseState<'tcx>) -> &[AssocItem<'tcx>]
pub fn items(&self, s: &impl BaseState<'tcx>) -> &[AssocItem<'tcx>]
Associated items, in definition order.
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> !DynSync for Trait<'tcx>
impl<'tcx> !Freeze for Trait<'tcx>
impl<'tcx> !RefUnwindSafe for Trait<'tcx>
impl<'tcx> !Sync for Trait<'tcx>
impl<'tcx> !UnwindSafe for Trait<'tcx>
impl<'tcx> DynSend for Trait<'tcx>
impl<'tcx> Send for Trait<'tcx>
impl<'tcx> Unpin for Trait<'tcx>
impl<'tcx> UnsafeUnpin for Trait<'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