pub trait Cx: Copy {
    type Input: Debug + Eq + Hash + Copy;
    type Result: Debug + Eq + Hash + Copy;
    type DepNodeIndex;
    type Tracked<T: Debug + Clone>: Debug;

    // Required methods
    fn mk_tracked<T>(
        self,
        data: T,
        dep_node_index: Self::DepNodeIndex,
    ) -> Self::Tracked<T>
       where T: Debug + Clone;
    fn get_tracked<T>(self, tracked: &Self::Tracked<T>) -> T
       where T: Debug + Clone;
    fn with_cached_task<T>(
        self,
        task: impl FnOnce() -> T,
    ) -> (T, Self::DepNodeIndex);
    fn with_global_cache<R>(
        self,
        f: impl FnOnce(&mut GlobalCache<Self>) -> R,
    ) -> R;
    fn evaluation_is_concurrent(&self) -> bool;
}
Expand description

The search graph does not simply use Interner directly to enable its fuzzing without having to stub the rest of the interner. We don’t make this a super trait of Interner as users of the shared type library shouldn’t have to care about Input and Result as they are implementation details of the search graph.

Required Associated Types§

type Input: Debug + Eq + Hash + Copy

type Result: Debug + Eq + Hash + Copy

type DepNodeIndex

type Tracked<T: Debug + Clone>: Debug

Required Methods§

fn mk_tracked<T>( self, data: T, dep_node_index: Self::DepNodeIndex, ) -> Self::Tracked<T>
where T: Debug + Clone,

fn get_tracked<T>(self, tracked: &Self::Tracked<T>) -> T
where T: Debug + Clone,

fn with_cached_task<T>( self, task: impl FnOnce() -> T, ) -> (T, Self::DepNodeIndex)

fn with_global_cache<R>(self, f: impl FnOnce(&mut GlobalCache<Self>) -> R) -> R

fn evaluation_is_concurrent(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl<I> Cx for I
where I: Interner,