hir_def::dyn_map

Trait Policy

Source
pub trait Policy {
    type K;
    type V;

    // Required methods
    fn insert(map: &mut DynMap, key: Self::K, value: Self::V);
    fn get<'a>(map: &'a DynMap, key: &Self::K) -> Option<&'a Self::V>;
    fn is_empty(map: &DynMap) -> bool;
}

Required Associated Types§

Source

type K

Source

type V

Required Methods§

Source

fn insert(map: &mut DynMap, key: Self::K, value: Self::V)

Source

fn get<'a>(map: &'a DynMap, key: &Self::K) -> Option<&'a Self::V>

Source

fn is_empty(map: &DynMap) -> 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.

Implementations on Foreign Types§

Source§

impl<K: Hash + Eq + 'static, V: 'static> Policy for (K, V)

Source§

type K = K

Source§

type V = V

Source§

fn insert(map: &mut DynMap, key: K, value: V)

Source§

fn get<'a>(map: &'a DynMap, key: &K) -> Option<&'a V>

Source§

fn is_empty(map: &DynMap) -> bool

Implementors§

Source§

impl<AST: AstNode + 'static, ID: 'static> Policy for AstPtrPolicy<AST, ID>

Source§

type K = AstPtr<AST>

Source§

type V = ID