Skip to main content

Step

Trait Step 

Source
pub trait Step: Bounds + Sized {
    // Provided method
    fn step(self, n: i32) -> Stepped<Self> { ... }
}
Expand description

Adds a step to a range used as an index: x.i((0..6).step(2)), x.i((..).step(-1)) (see Stepped for negative steps).

Provided Methods§

Source

fn step(self, n: i32) -> Stepped<Self>

This range with every n-th position (negative: backwards, as Python’s ::-1).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Step for Range<i32>

Source§

impl Step for Range<usize>

Source§

impl Step for RangeFrom<i32>

Source§

impl Step for RangeFrom<usize>

Source§

impl Step for RangeFull

Source§

impl Step for RangeInclusive<i32>

Source§

impl Step for RangeInclusive<usize>

Source§

impl Step for RangeTo<i32>

Source§

impl Step for RangeTo<usize>

Source§

impl Step for RangeToInclusive<i32>

Source§

impl Step for RangeToInclusive<usize>

Implementors§