pub struct Walk {
pub base: usize,
pub steps: Vec<Steps>,
pub along: Vec<Option<usize>>,
pub strides: Vec<usize>,
}Expand description
How a copy walks its source: one entry for each axis of the copy, the source axis that each entry walks, and the offset of the positions on source axes that no entry walks. Axes that walk one source axis together read windows, as Windows::plan lays them out. Every reader of windows from Steps classifies them here: Walk::read gives what the axes along one source axis read.
Fields§
§base: usizeThe offset of the positions on source axes that no entry walks.
steps: Vec<Steps>One entry for each axis of the copy. The first entry along each walked axis holds that axis’s position in its start.
along: Vec<Option<usize>>The source axis that each entry walks, or None for an entry whose offsets are all 0, as for an axis of one item or a spread.
strides: Vec<usize>The source’s strides.
Implementations§
Source§impl Walk
impl Walk
Sourcepub fn new(tables: &[Steps], shape: &[usize], source: &[usize]) -> Option<Self>
pub fn new(tables: &[Steps], shape: &[usize], source: &[usize]) -> Option<Self>
The walk that tables give for a copy of shape from a source of shape source. None where an entry doesn’t walk one source axis, where a walked axis’s position can’t move into the start of a Stride, as for a Padded or Rotated entry over part of an axis, and where the source is empty.
Sourcepub fn walking(&self, a: usize) -> impl Iterator<Item = usize> + '_
pub fn walking(&self, a: usize) -> impl Iterator<Item = usize> + '_
The axes of the copy that walk source axis a, in order.
Sourcepub fn read(&self, a: usize, n: usize) -> Option<(usize, Vec<[usize; 2]>)>
pub fn read(&self, a: usize, n: usize) -> Option<(usize, Vec<[usize; 2]>)>
What the entries walking source axis a, of n items, read as windows, such as a copy’s frames and the positions in each window: where the windows start, and each entry’s length and move in positions. Each entry must be a Stride that steps forward by a whole number of positions. An axis that no entry walks reads position 0. None for any other entries, and where the windows don’t lie inside the axis.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Walk
impl !UnwindSafe for Walk
impl Forget for Walk
impl Freeze for Walk
impl Send for Walk
impl Sync for Walk
impl Unpin for Walk
impl UnsafeUnpin for Walk
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<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