MapStorage

Trait MapStorage 

Source
pub trait MapStorage<Out> {
    type Input;
    type Output;

    // Required method
    fn map_storage<F: FnOnce(Self::Input) -> Out>(self, f: F) -> Self::Output;
}
Expand description

Map the storage type into another given a conversion function.

This is useful for changing storage is not just a simple Vec or slice but a combination of independent collections.

Required Associated Types§

Required Methods§

Source

fn map_storage<F: FnOnce(Self::Input) -> Out>(self, f: F) -> Self::Output

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<S, Out> MapStorage<Out> for Vec<S>

Source§

type Input = Vec<S>

Source§

type Output = Out

Source§

fn map_storage<F: FnOnce(Self::Input) -> Out>(self, f: F) -> Self::Output

Source§

impl<S, T, Out> MapStorage<Out> for (S, T)

Source§

type Input = (S, T)

Source§

type Output = Out

Source§

fn map_storage<F: FnOnce(Self::Input) -> Out>(self, f: F) -> Self::Output

Source§

impl<T, Out> MapStorage<Out> for &[T]

Source§

type Input = &[T]

Source§

type Output = Out

Source§

fn map_storage<F: FnOnce(Self::Input) -> Out>(self, f: F) -> Self::Output

Source§

impl<T, Out> MapStorage<Out> for &mut [T]

Source§

type Input = &mut [T]

Source§

type Output = Out

Source§

fn map_storage<F: FnOnce(Self::Input) -> Out>(self, f: F) -> Self::Output

Implementors§

Source§

impl<S: MapStorage<Out>, I, Out> MapStorage<Out> for Select<S, I>

Source§

type Input = <S as MapStorage<Out>>::Input

Source§

type Output = Select<<S as MapStorage<Out>>::Output, I>

Source§

impl<S: MapStorage<Out>, I, Out> MapStorage<Out> for Subset<S, I>

Source§

type Input = <S as MapStorage<Out>>::Input

Source§

type Output = Subset<<S as MapStorage<Out>>::Output, I>

Source§

impl<S: MapStorage<Out>, N, Out> MapStorage<Out> for UniChunked<S, N>

Map the underlying storage type.

Source§

type Input = <S as MapStorage<Out>>::Input

Source§

type Output = UniChunked<<S as MapStorage<Out>>::Output, N>

Source§

impl<S: MapStorage<Out>, O, Out> MapStorage<Out> for Chunked<S, O>

Source§

type Input = <S as MapStorage<Out>>::Input

Source§

type Output = Chunked<<S as MapStorage<Out>>::Output, O>

Source§

impl<S: MapStorage<Out>, T, I, Out> MapStorage<Out> for Sparse<S, T, I>

Source§

type Input = <S as MapStorage<Out>>::Input

Source§

type Output = Sparse<<S as MapStorage<Out>>::Output, T, I>