Trait refuse::MapAs

source ·
pub trait MapAs: Send + Sync + 'static {
    type Target: ?Sized + 'static;

    // Required method
    fn map_as(&self) -> &Self::Target;
}
Expand description

A mapping from one type to another.

This trait is used by AnyRef::load_mapped() to enable type-erased loading of a secondary type.

If no mapping is desired, implement NoMapping instead.

Required Associated Types§

source

type Target: ?Sized + 'static

The target type of the mapping.

Required Methods§

source

fn map_as(&self) -> &Self::Target

Maps self to target type.

Implementors§

source§

impl<T> MapAs for T
where T: NoMapping,

§

type Target = ()