IteratorOps

Trait IteratorOps 

Source
pub trait IteratorOps:
    Num
    + PartialOrd
    + Copy
    + Debug
    + Display {
    type Step: StepOps;
    type ExtendedStep: StepOps;

    // Required methods
    fn min() -> Self;
    fn max() -> Self;
    fn to_step(self) -> Self::Step;
    fn from_step(step: Self::Step) -> Self;
    fn to_extended_step(self) -> Self::ExtendedStep;
    fn from_extended_step(extended_step: Self::ExtendedStep) -> Self;
    fn extend_step(step: Self::Step) -> Self::ExtendedStep;

    // Provided method
    fn next(&mut self, step: Self::Step) { ... }
}
Expand description

IteratorOps describes trait for ‘from’/‘to’ in ‘for’ loop

Required Associated Types§

Source

type Step: StepOps

Step is the type for ‘step’, signed counterpart of ‘from’/’to

Source

type ExtendedStep: StepOps

Required Methods§

Source

fn min() -> Self

Source

fn max() -> Self

Source

fn to_step(self) -> Self::Step

Source

fn from_step(step: Self::Step) -> Self

Source

fn to_extended_step(self) -> Self::ExtendedStep

Source

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Provided Methods§

Source

fn next(&mut self, step: Self::Step)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IteratorOps for f32

Source§

type Step = f32

Source§

type ExtendedStep = f64

Source§

fn min() -> f32

Source§

fn max() -> f32

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

fn next(&mut self, step: Self::Step)

Source§

impl IteratorOps for f64

Source§

type Step = f64

Source§

type ExtendedStep = f64

Source§

fn min() -> f64

Source§

fn max() -> f64

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(step: Self::Step) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

fn next(&mut self, step: Self::Step)

Source§

impl IteratorOps for i8

Source§

type Step = i8

Source§

type ExtendedStep = i16

Source§

fn min() -> Self

Source§

fn max() -> Self

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for i16

Source§

type Step = i16

Source§

type ExtendedStep = i32

Source§

fn min() -> Self

Source§

fn max() -> Self

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for i32

Source§

type Step = i32

Source§

type ExtendedStep = i64

Source§

fn min() -> Self

Source§

fn max() -> Self

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for i64

Source§

type Step = i64

Source§

type ExtendedStep = i128

Source§

fn min() -> Self

Source§

fn max() -> Self

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for i128

Source§

type Step = i128

Source§

type ExtendedStep = i128

Source§

fn min() -> i128

Source§

fn max() -> i128

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for isize

Source§

type Step = isize

Source§

type ExtendedStep = isize

Source§

fn min() -> isize

Source§

fn max() -> isize

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for u8

Source§

type Step = i8

Source§

type ExtendedStep = i16

Source§

fn min() -> Self

Source§

fn max() -> Self

Source§

fn to_step(self) -> i8

Source§

fn from_step(step: i8) -> u8

Source§

fn to_extended_step(self) -> i16

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for u16

Source§

type Step = i16

Source§

type ExtendedStep = i32

Source§

fn min() -> Self

Source§

fn max() -> Self

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for u32

Source§

type Step = i32

Source§

type ExtendedStep = i64

Source§

fn min() -> Self

Source§

fn max() -> Self

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for u64

Source§

type Step = i64

Source§

type ExtendedStep = i128

Source§

fn min() -> Self

Source§

fn max() -> Self

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(extended_step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for u128

Source§

type Step = i128

Source§

type ExtendedStep = i128

Source§

fn min() -> Self

Source§

fn max() -> Self

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Source§

impl IteratorOps for usize

Source§

type Step = isize

Source§

type ExtendedStep = isize

Source§

fn min() -> Self

Source§

fn max() -> Self

Source§

fn to_step(self) -> Self::Step

Source§

fn from_step(step: Self::Step) -> Self

Source§

fn to_extended_step(self) -> Self::ExtendedStep

Source§

fn from_extended_step(step: Self::ExtendedStep) -> Self

Source§

fn extend_step(step: Self::Step) -> Self::ExtendedStep

Implementors§