Skip to main content

MapWith

Trait MapWith 

Source
pub trait MapWith: Map + MapInternWith {
    // Required method
    fn map_with<R, Item2, F>(
        self,
        other: Self::WithType<Item2>,
        f: F,
    ) -> Self::WithType<R>
       where F: FnMut(Self::Item, Item2) -> R;
}
Expand description

Elementwise mapping of two containers with possibly different item types.

Required Methods§

Source

fn map_with<R, Item2, F>( self, other: Self::WithType<Item2>, f: F, ) -> Self::WithType<R>
where F: FnMut(Self::Item, Item2) -> R,

Combine self and other elementwise with f, producing a new container of the mapped values.

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<T> MapWith for Vec<T>

Source§

fn map_with<R, Item2, F>( self, other: <Vec<T> as Map>::WithType<Item2>, f: F, ) -> <Vec<T> as Map>::WithType<R>
where F: FnMut(<Vec<T> as MapIntern>::Item, Item2) -> R,

Source§

impl<T, const N: usize> MapWith for [T; N]

Source§

fn map_with<R, Item2, F>( self, other: <[T; N] as Map>::WithType<Item2>, f: F, ) -> <[T; N] as Map>::WithType<R>
where F: FnMut(<[T; N] as MapIntern>::Item, Item2) -> R,

Implementors§

Source§

impl<T> MapWith for HslaOf<T>

Source§

impl<T> MapWith for RgbaOf<T>

Source§

impl<T> MapWith for RectangleOf<T>

Source§

impl<T, Idx> MapWith for ImageBaseOf<T, Idx>
where Idx: Integer,

Source§

impl<T, Idx, const N: usize> MapWith for GridOf<T, Idx, N>
where Idx: Integer,

Source§

impl<T, const N: usize> MapWith for Vector<T, N>

Source§

impl<T, const ROW: usize, const COL: usize> MapWith for Matrix<T, ROW, COL>