Trait SubWith

Source
pub trait SubWith<K: Eq + Hash, V>: Sized {
    type Error;

    // Required method
    fn sub(&self, sub: &Sub<K, V>) -> Result<Self, Self::Error>;

    // Provided method
    fn with(&self, key: K, val: V) -> Result<Self, Self::Error> { ... }
}

Required Associated Types§

Required Methods§

Source

fn sub(&self, sub: &Sub<K, V>) -> Result<Self, Self::Error>

Provided Methods§

Source

fn with(&self, key: K, val: V) -> Result<Self, Self::Error>

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: Eq + Hash, V, E, T: SubWith<K, V, Error = E>> SubWith<K, V> for Option<T>

Source§

type Error = E

Source§

fn sub(&self, sub: &Sub<K, V>) -> Result<Self, Self::Error>

Source§

impl<K: Eq + Hash, V, E, T: SubWith<K, V, Error = E>> SubWith<K, V> for Vec<T>

Source§

type Error = E

Source§

fn sub(&self, sub: &Sub<K, V>) -> Result<Self, Self::Error>

Implementors§

Source§

impl<'a, K: Clone + Eq + Hash, V: Clone + SubWith<K, V, Error = E>, E> SubWith<K, V> for CowSub<'a, K, V>

Source§

type Error = E

Source§

impl<K: Eq + Hash, V, E, K2: Clone + Eq + Hash, V2: SubWith<K, V, Error = E>> SubWith<K, V> for HashMap<K2, V2>

Source§

type Error = E

Source§

impl<K: Clone + Eq + Hash, V: SubWith<K, V, Error = E>, E> SubWith<K, V> for Sub<K, V>

Source§

type Error = E

Source§

impl<L: Clone + Eq + Hash, V: Clone + Eq + Hash> SubWith<Var<V>, Ast<L, V>> for Ast<L, V>

Source§

impl<L: Clone, V: Clone + Eq + Hash> SubWith<Var<V>, Ast<L, V>> for Term<L, V>