Mappable

Trait Mappable 

Source
pub trait Mappable<D> {
    type Output<O>;

    // Required method
    fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>;
}
Expand description

Trait for structs used as an output of functions for which derivatives are calculated.

The main intention is to generalize the calculation of derivatives to fallible functions, but other use cases might also appear in the future.

Required Associated Types§

Source

type Output<O>

Required Methods§

Source

fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>

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 Mappable<f32> for f32

Source§

type Output<O> = O

Source§

fn map_dual<M: FnOnce(f32) -> O, O>(self, f: M) -> Self::Output<O>

Source§

impl Mappable<f64> for f64

Source§

type Output<O> = O

Source§

fn map_dual<M: FnOnce(f64) -> O, O>(self, f: M) -> Self::Output<O>

Source§

impl<D> Mappable<D> for ()

Source§

type Output<O> = ()

Source§

fn map_dual<M: FnOnce(D) -> O, O>(self, _: M)

Source§

impl<D, T1: Mappable<D>, T2: Mappable<D>> Mappable<D> for (T1, T2)

Source§

type Output<O> = (<T1 as Mappable<D>>::Output<O>, <T2 as Mappable<D>>::Output<O>)

Source§

fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>

Source§

impl<D, T1: Mappable<D>, T2: Mappable<D>, T3: Mappable<D>> Mappable<D> for (T1, T2, T3)

Source§

type Output<O> = (<T1 as Mappable<D>>::Output<O>, <T2 as Mappable<D>>::Output<O>, <T3 as Mappable<D>>::Output<O>)

Source§

fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>

Source§

impl<D, T1: Mappable<D>, T2: Mappable<D>, T3: Mappable<D>, T4: Mappable<D>> Mappable<D> for (T1, T2, T3, T4)

Source§

type Output<O> = (<T1 as Mappable<D>>::Output<O>, <T2 as Mappable<D>>::Output<O>, <T3 as Mappable<D>>::Output<O>, <T4 as Mappable<D>>::Output<O>)

Source§

fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>

Source§

impl<D, T1: Mappable<D>, T2: Mappable<D>, T3: Mappable<D>, T4: Mappable<D>, T5: Mappable<D>> Mappable<D> for (T1, T2, T3, T4, T5)

Source§

type Output<O> = (<T1 as Mappable<D>>::Output<O>, <T2 as Mappable<D>>::Output<O>, <T3 as Mappable<D>>::Output<O>, <T4 as Mappable<D>>::Output<O>, <T5 as Mappable<D>>::Output<O>)

Source§

fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>

Source§

impl<D, T: Mappable<D>> Mappable<D> for Option<T>

Source§

type Output<O> = Option<<T as Mappable<D>>::Output<O>>

Source§

fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>

Source§

impl<D, T: Mappable<D>> Mappable<D> for Vec<T>

Source§

type Output<O> = Vec<<T as Mappable<D>>::Output<O>>

Source§

fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>

Source§

impl<D, T: Mappable<D>, E> Mappable<D> for Result<T, E>

Source§

type Output<O> = Result<<T as Mappable<D>>::Output<O>, E>

Source§

fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>

Source§

impl<D, T: Mappable<D>, K: Eq + Hash> Mappable<D> for HashMap<K, T>

Source§

type Output<O> = HashMap<K, <T as Mappable<D>>::Output<O>>

Source§

fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>

Source§

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

Source§

type Output<O> = [<T as Mappable<D>>::Output<O>; N]

Source§

fn map_dual<M: Fn(D) -> O, O>(self, f: M) -> Self::Output<O>

Source§

impl<D: Scalar, R: Dim, C: Dim> Mappable<Matrix<D, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<D>>> for OMatrix<D, R, C>

Source§

type Output<O> = O

Source§

fn map_dual<M: Fn(Self) -> O, O>(self, f: M) -> O

Implementors§

Source§

impl<T: DualNum<F>, F> Mappable<Dual2<T, F>> for Dual2<T, F>

Source§

type Output<O> = O

Source§

impl<T: DualNum<F>, F> Mappable<Dual3<T, F>> for Dual3<T, F>

Source§

type Output<O> = O

Source§

impl<T: DualNum<F>, F> Mappable<Dual<T, F>> for Dual<T, F>

Source§

type Output<O> = O

Source§

impl<T: DualNum<F>, F> Mappable<HyperDual<T, F>> for HyperDual<T, F>

Source§

type Output<O> = O

Source§

impl<T: DualNum<F>, F> Mappable<HyperHyperDual<T, F>> for HyperHyperDual<T, F>

Source§

type Output<O> = O

Source§

impl<T: DualNum<F>, F> Mappable<Real<T, F>> for Real<T, F>

Source§

type Output<O> = O

Source§

impl<T: DualNum<F>, F, D: Dim> Mappable<Dual2Vec<T, F, D>> for Dual2Vec<T, F, D>

Source§

type Output<O> = O

Source§

impl<T: DualNum<F>, F, D: Dim> Mappable<DualVec<T, F, D>> for DualVec<T, F, D>

Source§

type Output<O> = O

Source§

impl<T: DualNum<F>, F, M: Dim, N: Dim> Mappable<HyperDualVec<T, F, M, N>> for HyperDualVec<T, F, M, N>

Source§

type Output<O> = O