[][src]Struct voladdress::VolSeries

pub struct VolSeries<T, C: Unsigned, S: Unsigned> { /* fields omitted */ }

A series of evenly strided addresses.

  • The C parameter is the element count of the series.
  • The S parameter is the stride (in bytes) from one element to the next.

This is for when you have something like "a series of 128 u16 values every 16 bytes starting at 0x700_0000".

Methods

impl<T, C: Unsigned, S: Unsigned> VolSeries<T, C, S>[src]

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

Constructs a new VolSeries.

Safety

The given address must be a valid VolAddress at each position in the series for however many slots (C), strided by the selected amount (S).

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

The length of this series (in elements)

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

Gives an iterator over the slots of this series.

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

Unchecked indexing into the series.

Safety

The slot given must be in bounds.

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

Checked "indexing" style access into the series, giving either a VolAddress or a panic.

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

Checked "getting" style access into the series, giving an Option value.

Trait Implementations

impl<T, C: Unsigned, S: Unsigned> Clone for VolSeries<T, C, S>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T, C: Unsigned, S: Unsigned> Debug for VolSeries<T, C, S>[src]

impl<T, C: Unsigned, S: Unsigned> PartialEq<VolSeries<T, C, S>> for VolSeries<T, C, S>[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl<T, C: Unsigned, S: Unsigned> Eq for VolSeries<T, C, S>[src]

impl<T, C: Unsigned, S: Unsigned> Copy for VolSeries<T, C, S>[src]

Auto Trait Implementations

impl<T, C, S> !Send for VolSeries<T, C, S>

impl<T, C, S> !Sync for VolSeries<T, C, S>

Blanket Implementations

impl<T> From for T[src]

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

type Error = !

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

The type returned in the event of a conversion error.

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

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

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

The type returned in the event of a conversion error.

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

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

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

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

impl<T> Same for T[src]

type Output = T

Should always be Self