Struct block_grid::Block [−][src]
pub struct Block<'a, T, B: BlockDim> { /* fields omitted */ }
Expand description
A view of a 2D block contiguous in memory.
Can be obtained via BlockIter
, which is created by calling BlockGrid::block_iter
.
Implementations
Returns the coordinates of the entire block.
Block coordinates mean that the (i, j)
refers to the i
-th row of blocks and the
j
-th block in that row. If you need the coordinates of the first (top-left) element,
use starts_at
instead.
Returns the coordinates of the first (top-left) element in the block.
Returns true
if the given coordinates are valid.
Returns a reference to the element at the given coordinates, or None
if they are
out-of-bounds.
Returns a reference to the element at the given coordinates, without bounds checking.
Safety
Calling this method with out-of-bounds coordinates is undefined-behaviour.
Trait Implementations
Auto Trait Implementations
impl<'a, T, B> RefUnwindSafe for Block<'a, T, B> where
B: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, B> UnwindSafe for Block<'a, T, B> where
B: UnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more