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.

Returns all elements in block as a slice in memory order.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.