pub trait Incrementablewhere
    Self: Sized,{
    // Required methods
    fn increment(&self) -> Option<Self>;
    fn initial_value() -> Option<Self>;
}
Expand description

A trait representing an incrementable type.

The increment and initial_value functions are fallible. They should either both return Some with a valid value, or None.

Required Methods§

source

fn increment(&self) -> Option<Self>

Increments the value.

Returns Some with the incremented value if it is possible, or None if it is not.

source

fn initial_value() -> Option<Self>

Returns the initial value.

Returns Some with the initial value if it is available, or None if it is not.

Implementations on Foreign Types§

source§

impl Incrementable for i128

source§

fn increment(&self) -> Option<Self>

source§

fn initial_value() -> Option<Self>

source§

impl Incrementable for i16

source§

fn increment(&self) -> Option<Self>

source§

fn initial_value() -> Option<Self>

source§

impl Incrementable for u128

source§

fn increment(&self) -> Option<Self>

source§

fn initial_value() -> Option<Self>

source§

impl Incrementable for u16

source§

fn increment(&self) -> Option<Self>

source§

fn initial_value() -> Option<Self>

source§

impl Incrementable for u64

source§

fn increment(&self) -> Option<Self>

source§

fn initial_value() -> Option<Self>

source§

impl Incrementable for i64

source§

fn increment(&self) -> Option<Self>

source§

fn initial_value() -> Option<Self>

source§

impl Incrementable for i32

source§

fn increment(&self) -> Option<Self>

source§

fn initial_value() -> Option<Self>

source§

impl Incrementable for u32

source§

fn increment(&self) -> Option<Self>

source§

fn initial_value() -> Option<Self>

source§

impl Incrementable for i8

source§

fn increment(&self) -> Option<Self>

source§

fn initial_value() -> Option<Self>

source§

impl Incrementable for u8

source§

fn increment(&self) -> Option<Self>

source§

fn initial_value() -> Option<Self>

Implementors§