pub enum Slice {
Positive {
offset: usize,
len: usize,
},
Negative {
offset_from_end: usize,
len: usize,
},
}Variants§
Implementations§
Source§impl Slice
impl Slice
pub fn len(&self) -> usize
pub fn len_mut(&mut self) -> &mut usize
Sourcepub fn positive_offset(&self) -> usize
pub fn positive_offset(&self) -> usize
Sourcepub fn end_position(&self) -> usize
pub fn end_position(&self) -> usize
Sourcepub fn offsetted(self, position: usize) -> Self
pub fn offsetted(self, position: usize) -> Self
Returns the equivalent slice to apply from an offsetted position.
§Panics
Panics if self is negative.
Sourcepub fn restrict_to_bounds(self, n_rows: usize) -> Self
pub fn restrict_to_bounds(self, n_rows: usize) -> Self
Restricts the bounds of the slice to within a number of rows. Negative slices will also be translated to the positive equivalent.
Trait Implementations§
impl Eq for Slice
impl StructuralPartialEq for Slice
Auto Trait Implementations§
impl Freeze for Slice
impl RefUnwindSafe for Slice
impl Send for Slice
impl Sync for Slice
impl Unpin for Slice
impl UnwindSafe for Slice
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§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
Compare self to
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>
Converts
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>
Converts
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