pub struct AlignedGrid<S> { /* private fields */ }
Expand description
A continuous buffer in the “raster order”.
The buffer is aligned so that it can be used in SIMD instructions.
Implementations§
Source§impl<S> AlignedGrid<S>
impl<S> AlignedGrid<S>
pub fn empty() -> AlignedGrid<S>
Source§impl<S> AlignedGrid<S>
impl<S> AlignedGrid<S>
Sourcepub fn with_alloc_tracker(
width: usize,
height: usize,
tracker: Option<&AllocTracker>,
) -> Result<AlignedGrid<S>, Error>
pub fn with_alloc_tracker( width: usize, height: usize, tracker: Option<&AllocTracker>, ) -> Result<AlignedGrid<S>, Error>
Create a new buffer, recording the allocation if a tracker is given.
Sourcepub fn clone_untracked(&self) -> AlignedGrid<S>
pub fn clone_untracked(&self) -> AlignedGrid<S>
Clones the buffer without recording an allocation.
Sourcepub fn try_clone(&self) -> Result<AlignedGrid<S>, Error>
pub fn try_clone(&self) -> Result<AlignedGrid<S>, Error>
Tries to clone the buffer, and records the allocation in the same tracker as the original buffer.
Source§impl<S> AlignedGrid<S>
impl<S> AlignedGrid<S>
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn tracker(&self) -> Option<AllocTracker>
pub fn get(&self, x: usize, y: usize) -> Option<&S>
pub fn get_mut(&mut self, x: usize, y: usize) -> Option<&mut S>
pub fn as_subgrid(&self) -> SharedSubgrid<'_, S>
pub fn as_subgrid_mut(&mut self) -> MutableSubgrid<'_, S>
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for AlignedGrid<S>
impl<S> RefUnwindSafe for AlignedGrid<S>where
S: RefUnwindSafe,
impl<S> Send for AlignedGrid<S>where
S: Send,
impl<S> Sync for AlignedGrid<S>where
S: Sync,
impl<S> Unpin for AlignedGrid<S>where
S: Unpin,
impl<S> UnwindSafe for AlignedGrid<S>where
S: 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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