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

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§