TupleMutMap

Trait TupleMutMap 

Source
pub trait TupleMutMap {
    type MutMap<'a>
       where Self: 'a;

    // Required method
    fn tuple_mut_map(&mut self) -> Self::MutMap<'_>;
}
Expand description

A trait for applying TupleMut to each element of a tuple.

This trait takes a mutable reference to a tuple where each element implements TupleMut and returns a tuple where each element is the result of calling tuple_mut() on the original elements.

§Examples

use tuplities_mut::TupleMutMap;

let mut matrix = ((1, 2), (3, 4), (5, 6));
let mut_ref_matrix = matrix.tuple_mut_map();
assert_eq!(mut_ref_matrix, ((&mut 1, &mut 2), (&mut 3, &mut 4), (&mut 5, &mut 6)));

Part of the tuplities crate.

Required Associated Types§

Source

type MutMap<'a> where Self: 'a

The type of a tuple containing tuples of mutable references to each inner element.

Required Methods§

Source

fn tuple_mut_map(&mut self) -> Self::MutMap<'_>

Returns a tuple where each element is a tuple of mutable references to the inner elements.

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 TupleMutMap for ()

Source§

type MutMap<'a> = () where Self: 'a

Source§

fn tuple_mut_map(&mut self) -> Self::MutMap<'_>

Source§

impl<T1: TupleMut> TupleMutMap for (T1,)

Source§

type MutMap<'a> = (<T1 as TupleMut>::Mut<'a>,) where Self: 'a

Source§

fn tuple_mut_map(&mut self) -> Self::MutMap<'_>

Source§

impl<T1: TupleMut, T2: TupleMut> TupleMutMap for (T1, T2)

Source§

type MutMap<'a> = (<T1 as TupleMut>::Mut<'a>, <T2 as TupleMut>::Mut<'a>) where Self: 'a

Source§

fn tuple_mut_map(&mut self) -> Self::MutMap<'_>

Source§

impl<T1: TupleMut, T2: TupleMut, T3: TupleMut> TupleMutMap for (T1, T2, T3)

Source§

type MutMap<'a> = (<T1 as TupleMut>::Mut<'a>, <T2 as TupleMut>::Mut<'a>, <T3 as TupleMut>::Mut<'a>) where Self: 'a

Source§

fn tuple_mut_map(&mut self) -> Self::MutMap<'_>

Source§

impl<T1: TupleMut, T2: TupleMut, T3: TupleMut, T4: TupleMut> TupleMutMap for (T1, T2, T3, T4)

Source§

type MutMap<'a> = (<T1 as TupleMut>::Mut<'a>, <T2 as TupleMut>::Mut<'a>, <T3 as TupleMut>::Mut<'a>, <T4 as TupleMut>::Mut<'a>) where Self: 'a

Source§

fn tuple_mut_map(&mut self) -> Self::MutMap<'_>

Source§

impl<T1: TupleMut, T2: TupleMut, T3: TupleMut, T4: TupleMut, T5: TupleMut> TupleMutMap for (T1, T2, T3, T4, T5)

Source§

type MutMap<'a> = (<T1 as TupleMut>::Mut<'a>, <T2 as TupleMut>::Mut<'a>, <T3 as TupleMut>::Mut<'a>, <T4 as TupleMut>::Mut<'a>, <T5 as TupleMut>::Mut<'a>) where Self: 'a

Source§

fn tuple_mut_map(&mut self) -> Self::MutMap<'_>

Source§

impl<T1: TupleMut, T2: TupleMut, T3: TupleMut, T4: TupleMut, T5: TupleMut, T6: TupleMut> TupleMutMap for (T1, T2, T3, T4, T5, T6)

Source§

type MutMap<'a> = (<T1 as TupleMut>::Mut<'a>, <T2 as TupleMut>::Mut<'a>, <T3 as TupleMut>::Mut<'a>, <T4 as TupleMut>::Mut<'a>, <T5 as TupleMut>::Mut<'a>, <T6 as TupleMut>::Mut<'a>) where Self: 'a

Source§

fn tuple_mut_map(&mut self) -> Self::MutMap<'_>

Source§

impl<T1: TupleMut, T2: TupleMut, T3: TupleMut, T4: TupleMut, T5: TupleMut, T6: TupleMut, T7: TupleMut> TupleMutMap for (T1, T2, T3, T4, T5, T6, T7)

Source§

type MutMap<'a> = (<T1 as TupleMut>::Mut<'a>, <T2 as TupleMut>::Mut<'a>, <T3 as TupleMut>::Mut<'a>, <T4 as TupleMut>::Mut<'a>, <T5 as TupleMut>::Mut<'a>, <T6 as TupleMut>::Mut<'a>, <T7 as TupleMut>::Mut<'a>) where Self: 'a

Source§

fn tuple_mut_map(&mut self) -> Self::MutMap<'_>

Source§

impl<T1: TupleMut, T2: TupleMut, T3: TupleMut, T4: TupleMut, T5: TupleMut, T6: TupleMut, T7: TupleMut, T8: TupleMut> TupleMutMap for (T1, T2, T3, T4, T5, T6, T7, T8)

Source§

type MutMap<'a> = (<T1 as TupleMut>::Mut<'a>, <T2 as TupleMut>::Mut<'a>, <T3 as TupleMut>::Mut<'a>, <T4 as TupleMut>::Mut<'a>, <T5 as TupleMut>::Mut<'a>, <T6 as TupleMut>::Mut<'a>, <T7 as TupleMut>::Mut<'a>, <T8 as TupleMut>::Mut<'a>) where Self: 'a

Source§

fn tuple_mut_map(&mut self) -> Self::MutMap<'_>

Implementors§