pub trait ReadVol: BaseVol {
// Required method
fn get(&self, pos: Vec3<i32>) -> Result<&Self::Vox, Self::Error>;
// Provided methods
fn get_unchecked(&self, pos: Vec3<i32>) -> &Self::Vox { ... }
fn ray(
&self,
from: Vec3<f32>,
to: Vec3<f32>,
) -> Ray<'_, Self, fn(&Self::Vox) -> bool, fn(&Self::Vox, Vec3<i32>)>
where Self: Sized { ... }
fn for_each_in(&self, aabb: Aabb<i32>, f: impl FnMut(Vec3<i32>, Self::Vox))
where Self::Vox: Copy { ... }
}
Expand description
A volume that provides read access to its voxel data.
Required Methods§
Provided Methods§
Sourcefn get_unchecked(&self, pos: Vec3<i32>) -> &Self::Vox
fn get_unchecked(&self, pos: Vec3<i32>) -> &Self::Vox
Get a reference to the voxel at the provided position in the volume. Many volumes provide a fast path, provided the position is always in-bounds. Note that this function is still safe.
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.