Trait DispatchKey

Source
trait DispatchKey: Sized {
    type LocalId;

    // Required method
    fn dispatch_query<R>(
        self,
        genv: GlobalEnv<'_, '_>,
        local: impl FnOnce(Self::LocalId) -> R,
        external: impl FnOnce(Self) -> Option<R>,
        default: impl FnOnce(Self) -> R,
    ) -> R;
}
Expand description

Logic to dispatch a def_id to a provider (local, external, or default). This is a trait so it can be implemented for DefId and for FluxDefId.

Required Associated Types§

Required Methods§

Source

fn dispatch_query<R>( self, genv: GlobalEnv<'_, '_>, local: impl FnOnce(Self::LocalId) -> R, external: impl FnOnce(Self) -> Option<R>, default: impl FnOnce(Self) -> R, ) -> R

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.

Implementations on Foreign Types§

Source§

impl DispatchKey for DefId

Source§

type LocalId = MaybeExternId

Source§

fn dispatch_query<R>( self, genv: GlobalEnv<'_, '_>, local: impl FnOnce(MaybeExternId) -> R, external: impl FnOnce(Self) -> Option<R>, default: impl FnOnce(Self) -> R, ) -> R

Implementors§