Struct voladdress::VolSeries[][src]

#[repr(transparent)]pub struct VolSeries<T, R, W, const C: usize, const S: usize> { /* fields omitted */ }

A volatile memory “series”.

This is intended to model when a portion of memory is a series of evenly spaced values that are not directly contiguous.

Generic Parameters

  • T / R / W: These parameters are applied to the VolAddress type returned when accessing the series in any way (indexing, iteration, etc).
  • C: the count of elements in the series.
  • S: the stride in bytes between series elements.

Safety

  • This type stores a VolAddress internally, and so you must follow all of those safety rules. Notably, the base address must never be zero.
  • The address space must legally contain C values of the T type, spaced every S bytes, starting from the base address.
  • The memory series must not wrap around the end of the address space.

Implementations

impl<T, R, W, const C: usize, const S: usize> VolSeries<T, R, W, C, S>[src]

#[must_use]pub const unsafe fn new(base: usize) -> Self[src]

Constructs the value.

Safety

  • As per the type docs.

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

The length of this series (in elements).

#[must_use]pub const fn stride(self) -> usize[src]

The stride of this series (in bytes).

#[must_use]pub const fn index(self, i: usize) -> VolAddress<T, R, W>[src]

Indexes to the ith position of the memory series.

Panics

  • If the index is out of bounds this will panic.

#[must_use]pub const fn get(self, i: usize) -> Option<VolAddress<T, R, W>>[src]

Gets the address of the ith position, if it’s in bounds.

#[must_use]pub const fn iter(self) -> VolSeriesIter<T, R, W, S>

Notable traits for VolSeriesIter<T, R, W, S>

impl<T, R, W, const S: usize> Iterator for VolSeriesIter<T, R, W, S> type Item = VolAddress<T, R, W>;
[src]

Creates an iterator over the addresses of the memory series.

Trait Implementations

impl<T, R, W, const C: usize, const S: usize> Clone for VolSeries<T, R, W, C, S>[src]

impl<T, R, W, const C: usize, const S: usize> Copy for VolSeries<T, R, W, C, S>[src]

impl<T, R, W, const C: usize, const S: usize> Debug for VolSeries<T, R, W, C, S>[src]

impl<T: Eq, R: Eq, W: Eq, const C: usize, const S: usize> Eq for VolSeries<T, R, W, C, S>[src]

impl<T: Hash, R: Hash, W: Hash, const C: usize, const S: usize> Hash for VolSeries<T, R, W, C, S>[src]

impl<T: Ord, R: Ord, W: Ord, const C: usize, const S: usize> Ord for VolSeries<T, R, W, C, S>[src]

impl<T: PartialEq, R: PartialEq, W: PartialEq, const C: usize, const S: usize> PartialEq<VolSeries<T, R, W, C, S>> for VolSeries<T, R, W, C, S>[src]

impl<T: PartialOrd, R: PartialOrd, W: PartialOrd, const C: usize, const S: usize> PartialOrd<VolSeries<T, R, W, C, S>> for VolSeries<T, R, W, C, S>[src]

impl<T, R, W, const C: usize, const S: usize> StructuralEq for VolSeries<T, R, W, C, S>[src]

impl<T, R, W, const C: usize, const S: usize> StructuralPartialEq for VolSeries<T, R, W, C, S>[src]

Auto Trait Implementations

impl<T, R, W, const C: usize, const S: usize> Send for VolSeries<T, R, W, C, S> where
    R: Send,
    T: Send,
    W: Send

impl<T, R, W, const C: usize, const S: usize> Sync for VolSeries<T, R, W, C, S> where
    R: Sync,
    T: Sync,
    W: Sync

impl<T, R, W, const C: usize, const S: usize> Unpin for VolSeries<T, R, W, C, S> where
    R: Unpin,
    T: Unpin,
    W: Unpin

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.