pub struct RantRange { /* private fields */ }
Expand description
Represents Rant’s range
type, which characterizes a closed range of integers with an exclusive end bound.
Includes a step
value which specifies how far apart adjacent values in the range should be.
If the size of the range isn’t evenly divisible by step
, the ending step will be smaller.
Implementations
sourceimpl RantRange
impl RantRange
sourcepub fn abs_size(&self) -> usize
pub fn abs_size(&self) -> usize
Gets the absolute difference between the start and end bounds, ignoring the step size.
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Gets the total number of steps in the range, taking into account the step size.
pub fn sliced(&self, from: Option<usize>, to: Option<usize>) -> Option<Self>
sourcepub fn to_rant_list(&self) -> RantList
pub fn to_rant_list(&self) -> RantList
Enumerates the values of the range and returns the results as a Rant list
object.
pub fn to_rant_tuple(&self) -> RantTuple
Trait Implementations
sourceimpl TryIntoRant for RantRange
impl TryIntoRant for RantRange
sourcefn try_into_rant(self) -> Result<RantValue, ValueError>
fn try_into_rant(self) -> Result<RantValue, ValueError>
Attempts to convert to a RantValue
.
impl StructuralPartialEq for RantRange
Auto Trait Implementations
impl RefUnwindSafe for RantRange
impl Send for RantRange
impl Sync for RantRange
impl Unpin for RantRange
impl UnwindSafe for RantRange
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more