Skip to main content

MapTable

Trait MapTable 

Source
pub trait MapTable<'scope>: TableHKT {
    // Required methods
    fn map_modes<Mapper, DestMode>(
        self,
        mapper: &mut Mapper,
    ) -> Self::InMode<DestMode>
       where Mapper: ModeMapper<'scope, Self::Mode, DestMode>,
             DestMode: TableMode;
    fn map_modes_ref<Mapper, DestMode>(
        &self,
        mapper: &mut Mapper,
    ) -> Self::InMode<DestMode>
       where Mapper: ModeMapperRef<'scope, Self::Mode, DestMode>,
             DestMode: TableMode;
    fn map_modes_mut<Mapper, DestMode>(
        &mut self,
        mapper: &mut Mapper,
    ) -> Self::InMode<DestMode>
       where Mapper: ModeMapperMut<'scope, Self::Mode, DestMode>,
             DestMode: TableMode;
}
Expand description

This trait allows us to change the mode of a table by mapping all the fields with ModeMapper, ModeMapperRef, or ModeMapperMut.

Required Methods§

Source

fn map_modes<Mapper, DestMode>( self, mapper: &mut Mapper, ) -> Self::InMode<DestMode>
where Mapper: ModeMapper<'scope, Self::Mode, DestMode>, DestMode: TableMode,

Map each field of the table

The order and number of fields visited must always remain the same, across: Table::visit, Table::visit_mut, and all methods of MapTable.

Source

fn map_modes_ref<Mapper, DestMode>( &self, mapper: &mut Mapper, ) -> Self::InMode<DestMode>
where Mapper: ModeMapperRef<'scope, Self::Mode, DestMode>, DestMode: TableMode,

Map each field of the table, with a reference

The order and number of fields visited must always remain the same, across: Table::visit, Table::visit_mut, and all methods of MapTable.

Source

fn map_modes_mut<Mapper, DestMode>( &mut self, mapper: &mut Mapper, ) -> Self::InMode<DestMode>
where Mapper: ModeMapperMut<'scope, Self::Mode, DestMode>, DestMode: TableMode,

Map each field of the table, with a mutable reference

The order and number of fields visited must always remain the same, across: Table::visit, Table::visit_mut, and all methods of MapTable.

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<'scope, Mode: TableMode, A> MapTable<'scope> for One<'scope, Mode, A>
where A: Value,

Source§

impl<'scope, Mode: TableMode, A, B> MapTable<'scope> for Two<'scope, Mode, A, B>
where A: Value, B: Value,

Source§

impl<'scope, Mode: TableMode, A, B, C> MapTable<'scope> for Three<'scope, Mode, A, B, C>
where A: Value, B: Value, C: Value,