Struct veloren_common::volumes::vol_grid_3d::VolGrid3d
source · pub struct VolGrid3d<V: RasterableVol> {
chunks: HashMap<Vec3<i32>, Arc<V>>,
}
Fields§
§chunks: HashMap<Vec3<i32>, Arc<V>>
Implementations§
source§impl<V: RasterableVol> VolGrid3d<V>
impl<V: RasterableVol> VolGrid3d<V>
source§impl<V: RasterableVol> VolGrid3d<V>
impl<V: RasterableVol> VolGrid3d<V>
pub fn new() -> Result<Self, VolGrid3dError<V>>
pub fn chunk_size() -> Vec3<u32>
pub fn insert(&mut self, key: Vec3<i32>, chunk: Arc<V>) -> Option<Arc<V>>
pub fn get_key(&self, key: Vec3<i32>) -> Option<&V>
pub fn get_key_arc(&self, key: Vec3<i32>) -> Option<&Arc<V>>
pub fn remove(&mut self, key: Vec3<i32>) -> Option<Arc<V>>
pub fn key_pos(&self, key: Vec3<i32>) -> Vec3<i32>
pub fn pos_key(&self, pos: Vec3<i32>) -> Vec3<i32>
pub fn iter(&self) -> ChunkIter<'_, V> ⓘ
Trait Implementations§
source§impl<V: RasterableVol + ReadVol + Debug> ReadVol for VolGrid3d<V>
impl<V: RasterableVol + ReadVol + Debug> ReadVol for VolGrid3d<V>
source§fn get(&self, pos: Vec3<i32>) -> Result<&V::Vox, VolGrid3dError<V>>
fn get(&self, pos: Vec3<i32>) -> Result<&V::Vox, VolGrid3dError<V>>
Get a reference to the voxel at the provided position in the volume.
Auto Trait Implementations§
impl<V> Freeze for VolGrid3d<V>
impl<V> RefUnwindSafe for VolGrid3d<V>where
V: RefUnwindSafe,
impl<V> Send for VolGrid3d<V>
impl<V> Sync for VolGrid3d<V>
impl<V> Unpin for VolGrid3d<V>
impl<V> UnwindSafe for VolGrid3d<V>where
V: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more