DataMapper

Trait DataMapper 

Source
pub trait DataMapper: Send + 'static {
    type In: Data;
    type Out: Send + 'static;

    // Required method
    fn map(self, data: Self::In) -> Result<Self::Out>;
}
Expand description

Data mapper, to map data from an In type to an Out type, this is useful for using the built-in caching mechanism of the DataLoader

Required Associated Types§

Source

type In: Data

Source

type Out: Send + 'static

Required Methods§

Source

fn map(self, data: Self::In) -> Result<Self::Out>

Implementors§

Source§

impl<F, In: Data, Out: Send + 'static> DataMapper for MapperFn<F, In, Out>
where F: FnOnce(In) -> Result<Out> + Send + 'static,

Source§

type In = In

Source§

type Out = Out