pub trait HMappable<Mapper> {
type Output;
// Required method
fn map(self, mapper: Mapper) -> Self::Output;
}
Expand description
Trait for mapping over an HList
This trait is part of the implementation of the inherent method
HCons::map
. Please see that method for more information.
You only need to import this trait when working with generic
HLists or Mappers of unknown type. If the type of everything is known,
then list.map(f)
should “just work” even without the trait.
Required Associated Types§
Required Methods§
sourcefn map(self, mapper: Mapper) -> Self::Output
fn map(self, mapper: Mapper) -> Self::Output
Apply a function to each element of an HList.
Please see the inherent method for more information.
The only difference between that inherent method and this trait method is the location of the type parameters. (here, they are on the trait rather than the method)