MapAs

Trait 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,