Skip to main content

UnderOwnerState

Trait UnderOwnerState 

Source
pub trait UnderOwnerState<'tcx>: BaseState<'tcx> {
    // Required method
    fn owner(&self) -> DefId;

    // Provided methods
    fn param_env(&self) -> ParamEnv<'tcx> { ... }
    fn typing_env(&self) -> TypingEnv<'tcx> { ... }
    fn as_state_with_owner(&self) -> StateWithOwner<'tcx> { ... }
    fn with_cache<T>(&self, f: impl FnOnce(&mut ItemCache<'tcx>) -> T) -> T { ... }
    fn with_predicate_searcher<T>(
        &self,
        f: impl FnOnce(&mut PredicateSearcher<'tcx>, &StateWithBase<'tcx>) -> T,
    ) -> T { ... }
}

Required Methods§

Source

fn owner(&self) -> DefId

Provided Methods§

Source

fn param_env(&self) -> ParamEnv<'tcx>

Source

fn typing_env(&self) -> TypingEnv<'tcx>

Source

fn as_state_with_owner(&self) -> StateWithOwner<'tcx>

Source

fn with_cache<T>(&self, f: impl FnOnce(&mut ItemCache<'tcx>) -> T) -> T

Access the cache for the current item. You must not call sinto within this function as this will likely result in BorrowMut panics.

Source

fn with_predicate_searcher<T>( &self, f: impl FnOnce(&mut PredicateSearcher<'tcx>, &StateWithBase<'tcx>) -> T, ) -> T

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'tcx, A: UnderOwnerState<'tcx>, B> UnderOwnerState<'tcx> for (A, B)

Source§

fn owner(&self) -> DefId

Implementors§

Source§

impl<'tcx> UnderOwnerState<'tcx> for StateWithOwner<'tcx>