pub enum Period<'a> {
Repeats(usize),
Cycles(usize),
Walks {
len: usize,
base: usize,
steps: &'a [Steps],
},
}Expand description
How a mapping’s positions read the same items again (Mapping::period).
Variants§
Repeats(usize)
Each item repeats over this many consecutive positions.
Cycles(usize)
Every this many positions read the source’s first items again, in order, as Tiled reads them.
Walks
Every len positions read the same items again, through entries: those that steps reach from base. Reading a cycle in place walks its entries, so a reader gathers one cycle first (tiled_cycle).
Implementations§
Source§impl Period<'_>
impl Period<'_>
Sourcepub fn tiling(&self, run: usize) -> Option<(usize, usize)>
pub fn tiling(&self, run: usize) -> Option<(usize, usize)>
How a reader takes this cycle in runs of up to run positions: the period, and how many positions it writes the cycle out over (tiled_cycle). A cycle shorter than LONG_CYCLE, read in order or by walking entries, is written out over run positions, so that a run reads it in place at any phase. A longer walk is gathered once with no repeats. None for a longer cycle read in order, which a run reads in place, and for repeats.
Trait Implementations§
impl<'a> Copy for Period<'a>
impl<'a> Eq for Period<'a>
impl<'a> StructuralPartialEq for Period<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Period<'a>
impl<'a> !UnwindSafe for Period<'a>
impl<'a> Forget for Period<'a>
impl<'a> Freeze for Period<'a>
impl<'a> Send for Period<'a>
impl<'a> Sync for Period<'a>
impl<'a> Unpin for Period<'a>
impl<'a> UnsafeUnpin for Period<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more