pub enum Edge {
Fill,
Clamp,
Wrap,
Reflect,
Symmetric,
}Expand description
How a position outside an axis maps to one inside it, as edge modes of padding do. Fill gives no position, which reads the fill.
Variants§
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn position(self, p: i64, n: usize) -> Option<usize>
pub fn position(self, p: i64, n: usize) -> Option<usize>
The position on an axis of n items that position p reads, or None for the fill. A position inside the axis stays as it is in every mode. A negative p is outside the axis here. Reflect leaves out the edge item, as NumPy’s reflect does, so -1 reads 1. Symmetric repeats it, as NumPy’s symmetric does, so -1 reads 0. An empty axis gives None in every mode.
Sourcepub fn positions(
self,
view: View<'_>,
n: usize,
t: Tolerance,
) -> Result<Edged, Error>
pub fn positions( self, view: View<'_>, n: usize, t: Tolerance, ) -> Result<Edged, Error>
The position on an axis of n items that each index value in view reads (position): integers as they are, and floats as float_position reads them within tolerance t. A NaN, or a float that isn’t a whole number, reads the fill.
Sourcepub fn mapped(
self,
n: usize,
nan: bool,
signed: impl ExactSizeIterator<Item = Option<i64>>,
) -> Edged
pub fn mapped( self, n: usize, nan: bool, signed: impl ExactSizeIterator<Item = Option<i64>>, ) -> Edged
What Edge::positions gives for signed positions, each None for a NaN, where nan says whether any is. Where Fill or an empty axis reads the fill for some position, or a position is NaN, the result is floats.
Trait Implementations§
impl Copy for Edge
impl Eq for Edge
impl StructuralPartialEq for Edge
Auto Trait Implementations§
impl Forget for Edge
impl Freeze for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnsafeUnpin for Edge
impl UnwindSafe for Edge
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