ChunkMapBuilder

Trait ChunkMapBuilder 

Source
pub trait ChunkMapBuilder<N, T>: Sized {
    type Chunk: Chunk;

    // Required methods
    fn chunk_shape(&self) -> PointN<N>;
    fn ambient_value(&self) -> T;
    fn new_ambient(&self, extent: ExtentN<N>) -> Self::Chunk;

    // Provided methods
    fn build_with_rw_storage<Store>(
        self,
        storage: Store,
    ) -> ChunkMap<N, T, Self, Store>
       where PointN<N>: IntegerPoint<N>,
             Store: ChunkReadStorage<N, Self::Chunk> + ChunkWriteStorage<N, Self::Chunk> { ... }
    fn build_with_read_storage<Store>(
        self,
        storage: Store,
    ) -> ChunkMap<N, T, Self, Store>
       where PointN<N>: IntegerPoint<N>,
             Store: ChunkReadStorage<N, Self::Chunk> { ... }
    fn build_with_write_storage<Store>(
        self,
        storage: Store,
    ) -> ChunkMap<N, T, Self, Store>
       where PointN<N>: IntegerPoint<N>,
             Store: ChunkWriteStorage<N, Self::Chunk> { ... }
    fn build_with_hash_map_storage(
        self,
    ) -> ChunkMap<N, T, Self, AHashMap<ChunkKey<N>, Self::Chunk>>
       where PointN<N>: IntegerPoint<N>,
             ChunkKey<N>: Eq + Hash { ... }
}
Expand description

An object that knows how to construct chunks for a ChunkMap.

Required Associated Types§

Required Methods§

Source

fn chunk_shape(&self) -> PointN<N>

Source

fn ambient_value(&self) -> T

Source

fn new_ambient(&self, extent: ExtentN<N>) -> Self::Chunk

Construct a new chunk with entirely ambient values.

Provided Methods§

Source

fn build_with_rw_storage<Store>( self, storage: Store, ) -> ChunkMap<N, T, Self, Store>
where PointN<N>: IntegerPoint<N>, Store: ChunkReadStorage<N, Self::Chunk> + ChunkWriteStorage<N, Self::Chunk>,

Create a new ChunkMap with the given storage which must implement both ChunkReadStorage and ChunkWriteStorage.

Source

fn build_with_read_storage<Store>( self, storage: Store, ) -> ChunkMap<N, T, Self, Store>
where PointN<N>: IntegerPoint<N>, Store: ChunkReadStorage<N, Self::Chunk>,

Create a new ChunkMap with the given storage which must implement ChunkReadStorage.

Source

fn build_with_write_storage<Store>( self, storage: Store, ) -> ChunkMap<N, T, Self, Store>
where PointN<N>: IntegerPoint<N>, Store: ChunkWriteStorage<N, Self::Chunk>,

Create a new ChunkMap with the given storage which must implement ChunkWriteStorage.

Source

fn build_with_hash_map_storage( self, ) -> ChunkMap<N, T, Self, AHashMap<ChunkKey<N>, Self::Chunk>>
where PointN<N>: IntegerPoint<N>, ChunkKey<N>: Eq + Hash,

Create a new ChunkMap using a SmallKeyHashMap as the chunk storage.

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<N, T, Chan> ChunkMapBuilder<N, T> for ChunkMapBuilderNxM<N, T, Chan>
where PointN<N>: IntegerPoint<N>, T: Clone, Chan: FillChannels<Data = T>,

Source§

type Chunk = Array<N, Chan>