Skip to main content

FieldMapper

Trait FieldMapper 

Source
pub trait FieldMapper<Context, Tag>: FieldGetter<Context, Tag> {
    // Required method
    fn map_field<T>(
        context: &Context,
        _tag: PhantomData<Tag>,
        mapper: impl for<'a> FnOnce(&'a Self::Value) -> &'a T,
    ) -> &T;
}
Expand description

The provider trait equivalent of MapField.

Required Methods§

Source

fn map_field<T>( context: &Context, _tag: PhantomData<Tag>, mapper: impl for<'a> FnOnce(&'a Self::Value) -> &'a T, ) -> &T

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.

Implementors§

Source§

impl<Getter, Context, Tag> FieldMapper<Context, Tag> for Getter
where Getter: FieldGetter<Context, Tag> + 'static, Tag: 'static,