pub struct Cube<T> {
pub data: Vec<T>,
pub x_size: usize,
pub y_size: usize,
pub z_size: usize,
}
Expand description
A generic cube.
Coordinate ordering: Y then Z then X
Fields§
§data: Vec<T>
§x_size: usize
§y_size: usize
§z_size: usize
Implementations§
Source§impl<T> Cube<T>
impl<T> Cube<T>
pub fn new(x_size: usize, y_size: usize, z_size: usize, def: T) -> Selfwhere
T: Clone,
pub fn new_default(x_size: usize, y_size: usize, z_size: usize) -> Self
pub fn from_raw( data: Vec<T>, x_size: usize, y_size: usize, z_size: usize, ) -> Self
pub fn fill(&mut self, value: T)where
T: Clone,
pub fn set(&mut self, x: usize, y: usize, z: usize, value: T)
pub fn add(&mut self, x: usize, y: usize, z: usize, value: T)where
T: AddAssign,
pub fn get(&self, x: usize, y: usize, z: usize) -> &T
pub fn get_mut(&mut self, x: usize, y: usize, z: usize) -> &mut T
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Cube<T>
impl<T> RefUnwindSafe for Cube<T>where
T: RefUnwindSafe,
impl<T> Send for Cube<T>where
T: Send,
impl<T> Sync for Cube<T>where
T: Sync,
impl<T> Unpin for Cube<T>where
T: Unpin,
impl<T> UnwindSafe for Cube<T>where
T: UnwindSafe,
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