SymmetricFoldMap

Trait SymmetricFoldMap 

Source
pub trait SymmetricFoldMap<K, V> {
    // Required methods
    fn symmetric_fold<R>(
        &self,
        other: &Self,
        init: R,
        f: impl FnMut(R, (&K, DiffElement<&V>)) -> R,
    ) -> R;
    fn len(&self) -> usize;
    fn nonincremental_fold<R>(
        &self,
        init: R,
        f: impl FnMut(R, (&K, &V)) -> R,
    ) -> R;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}

Required Methods§

Source

fn symmetric_fold<R>( &self, other: &Self, init: R, f: impl FnMut(R, (&K, DiffElement<&V>)) -> R, ) -> R

Source

fn len(&self) -> usize

Source

fn nonincremental_fold<R>(&self, init: R, f: impl FnMut(R, (&K, &V)) -> R) -> R

Basically self.iter().fold(init, f).

Provided Methods§

Source

fn is_empty(&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.

Implementations on Foreign Types§

Source§

impl<K: Ord, V: PartialEq> SymmetricFoldMap<K, V> for BTreeMap<K, V>

Source§

fn symmetric_fold<R>( &self, other: &Self, init: R, f: impl FnMut(R, (&K, DiffElement<&V>)) -> R, ) -> R

Source§

fn len(&self) -> usize

Source§

fn nonincremental_fold<R>(&self, init: R, f: impl FnMut(R, (&K, &V)) -> R) -> R

Source§

impl<K: Ord, V: PartialEq> SymmetricFoldMap<K, V> for Rc<BTreeMap<K, V>>

Source§

fn symmetric_fold<R>( &self, other: &Self, init: R, f: impl FnMut(R, (&K, DiffElement<&V>)) -> R, ) -> R

Source§

fn len(&self) -> usize

Source§

fn nonincremental_fold<R>(&self, init: R, f: impl FnMut(R, (&K, &V)) -> R) -> R

Implementors§