Struct voladdress::VolSeries
source · [−]#[repr(transparent)]pub struct VolSeries<T, R, W, const C: usize, const S: usize> { /* private fields */ }
Expand description
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 theVolAddress
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 theT
type, spaced everyS
bytes, starting from the base address. - The memory series must not wrap around the end of the address space.
Implementations
sourceimpl<T, R, W, const C: usize, const S: usize> VolSeries<T, R, W, C, S>
impl<T, R, W, const C: usize, const S: usize> VolSeries<T, R, W, C, S>
sourcepub const fn index(self, i: usize) -> VolAddress<T, R, W>
pub const fn index(self, i: usize) -> VolAddress<T, R, W>
Indexes to the i
th position of the memory series.
Panics
- If the index is out of bounds this will panic.
sourcepub const fn get(self, i: usize) -> Option<VolAddress<T, R, W>>
pub const fn get(self, i: usize) -> Option<VolAddress<T, R, W>>
Gets the address of the i
th position, if it’s in bounds.
sourcepub 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>;
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>;
Creates an iterator over the addresses of the memory series.
sourcepub fn iter_range<RB: RangeBounds<usize>>(
self,
r: RB
) -> 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>;
pub fn iter_range<RB: RangeBounds<usize>>(
self,
r: RB
) -> 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>;
Makes an iterator over the range bounds given.
If the range given is empty then your iterator will be empty.
Panics
- If the start or end of the range are out of bounds for the series.
Trait Implementations
sourceimpl<T: Hash, R: Hash, W: Hash, const C: usize, const S: usize> Hash for VolSeries<T, R, W, C, S>
impl<T: Hash, R: Hash, W: Hash, const C: usize, const S: usize> Hash for VolSeries<T, R, W, C, S>
sourceimpl<T: Ord, R: Ord, W: Ord, const C: usize, const S: usize> Ord for VolSeries<T, R, W, C, S>
impl<T: Ord, R: Ord, W: Ord, const C: usize, const S: usize> Ord for VolSeries<T, R, W, C, S>
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<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>
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>
sourceimpl<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>
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>
sourcefn partial_cmp(&self, other: &VolSeries<T, R, W, C, S>) -> Option<Ordering>
fn partial_cmp(&self, other: &VolSeries<T, R, W, C, S>) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T, R, W, const C: usize, const S: usize> Copy for VolSeries<T, R, W, C, S>
impl<T: Eq, R: Eq, W: Eq, const C: usize, const S: usize> Eq for VolSeries<T, R, W, C, S>
impl<T, R, W, const C: usize, const S: usize> StructuralEq for VolSeries<T, R, W, C, S>
impl<T, R, W, const C: usize, const S: usize> StructuralPartialEq for VolSeries<T, R, W, C, S>
Auto Trait Implementations
impl<T, R, W, const C: usize, const S: usize> RefUnwindSafe for VolSeries<T, R, W, C, S>where
R: RefUnwindSafe,
T: RefUnwindSafe,
W: RefUnwindSafe,
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,
impl<T, R, W, const C: usize, const S: usize> UnwindSafe for VolSeries<T, R, W, C, S>where
R: UnwindSafe,
T: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more