Trait veloren_common::vol::WriteVol

source ·
pub trait WriteVol: BaseVol {
    // Required method
    fn set(
        &mut self,
        pos: Vec3<i32>,
        vox: Self::Vox,
    ) -> Result<Self::Vox, Self::Error>;

    // Provided method
    fn map<F: FnOnce(Self::Vox) -> Self::Vox>(
        &mut self,
        pos: Vec3<i32>,
        f: F,
    ) -> Result<Self::Vox, Self::Error>
       where Self: ReadVol,
             Self::Vox: Clone { ... }
}
Expand description

A volume that provides write access to its voxel data.

Required Methods§

source

fn set( &mut self, pos: Vec3<i32>, vox: Self::Vox, ) -> Result<Self::Vox, Self::Error>

Set the voxel at the provided position in the volume to the provided value.

Provided Methods§

source

fn map<F: FnOnce(Self::Vox) -> Self::Vox>( &mut self, pos: Vec3<i32>, f: F, ) -> Result<Self::Vox, Self::Error>
where Self: ReadVol, Self::Vox: Clone,

Map a voxel to another using the provided function.

Object Safety§

This trait is not object safe.

Implementors§