pub struct Si(pub Ixs, pub Option<Ixs>, pub Ixs);
Expand description
A slice, a description of a range of an array axis.
Fields are begin
, end
and stride
, where
negative begin
or end
indexes are counted from the back
of the axis.
If end
is None
, the slice extends to the end of the axis.
§Examples
Si(0, None, 1)
is the full range of an axis.
Python equivalent is [:]
.
Si(a, Some(b), 2)
is every second element from a
until b
.
Python equivalent is [a:b:2]
.
Si(a, None, -1)
is every element, in reverse order, from a
until the end. Python equivalent is [a::-1]
Tuple Fields§
§0: Ixs
§1: Option<Ixs>
§2: Ixs
Implementations§
Trait Implementations§
impl Copy for Si
impl Eq for Si
impl StructuralPartialEq for Si
Auto Trait Implementations§
impl Freeze for Si
impl RefUnwindSafe for Si
impl Send for Si
impl Sync for Si
impl Unpin for Si
impl UnwindSafe for Si
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)