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