pub struct ArrayProxy<T, const COUNT: usize, const STRIDE: usize> { /* private fields */ }
Expand description
Access an array of COUNT
items of type T
with the items STRIDE
bytes
apart. This is a zero-sized-type. No objects of this type are ever
actually created, it is only a convenience for wrapping pointer arithmetic.
There is no safe way to produce items of this type. Unsafe code can produce
references by pointer casting. It is up to the unsafe code doing that, to
ensure that the memory really is backed by appropriate content.
Typically, this is used for accessing hardware registers.
Get a reference from an ArrayProxy with no bounds checking.
Get a reference from an ArrayProxy, or return None
if the index
is out of bounds.
Return the number of items.
The returned type after indexing.
Performs the indexing (
container[index]
) operation.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
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.