[][src]Struct voladdress::VolBlock

pub struct VolBlock<T, const COUNT: usize> { /* fields omitted */ }

A block of addresses all in a row.

  • The C parameter is the element count of the block.

This is for if you have something like "a block of 256 u16 values all in a row starting at 0x500_0000".

Methods

impl<T, const COUNT: usize> VolBlock<T, COUNT>[src]

pub const unsafe fn new(address: usize) -> Self[src]

Constructs a new VolBlock.

Safety

The given address must be a valid VolAddress at each position in the block for however many slots (C).

pub const fn len(self) -> usize[src]

The length of this block (in elements)

Important traits for VolIter<T>
pub const fn iter(self) -> VolIter<T>[src]

Gives an iterator over the slots of this block.

pub const unsafe fn index_unchecked(self, slot: usize) -> VolAddress<T>[src]

Unchecked indexing into the block.

Safety

The slot given must be in bounds.

pub fn index(self, slot: usize) -> VolAddress<T>[src]

Checked "indexing" style access of the block, giving either a VolAddress or a panic.

pub fn get(self, slot: usize) -> Option<VolAddress<T>>[src]

Checked "getting" style access of the block, giving an Option value.

Trait Implementations

impl<T, const COUNT: usize> Clone for VolBlock<T, COUNT>[src]

impl<T, const COUNT: usize> Copy for VolBlock<T, COUNT>[src]

impl<T, const COUNT: usize> Debug for VolBlock<T, COUNT>[src]

impl<T, const COUNT: usize> Eq for VolBlock<T, COUNT>[src]

impl<T, const COUNT: usize> PartialEq<VolBlock<T, COUNT>> for VolBlock<T, COUNT>[src]

Auto Trait Implementations

impl<const COUNT: usize, T> !Send for VolBlock<T, COUNT>

impl<const COUNT: usize, T> !Sync for VolBlock<T, COUNT>

impl<const COUNT: usize, T> Unpin for VolBlock<T, COUNT>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.