pub trait Incrementable: Sized + Clone {
// Required method
fn increment(&self) -> IncResult<Self>;
}
Required Methods§
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 Incrementable for i8
impl Incrementable for i8
Source§impl Incrementable for i16
impl Incrementable for i16
Source§impl Incrementable for i32
impl Incrementable for i32
Source§impl Incrementable for i64
impl Incrementable for i64
Source§impl Incrementable for i128
impl Incrementable for i128
Source§impl Incrementable for u8
impl Incrementable for u8
Source§impl Incrementable for u16
impl Incrementable for u16
Source§impl Incrementable for u32
impl Incrementable for u32
Source§impl Incrementable for u64
impl Incrementable for u64
Source§impl Incrementable for u128
impl Incrementable for u128
Source§impl Incrementable for String
impl Incrementable for String
Source§fn increment(&self) -> IncResult<Self>
fn increment(&self) -> IncResult<Self>
§Examples:
use increment::*;
assert_eq!("2", "1".to_string().increment().unwrap());
use increment::*;
assert_eq!("-2", "-3".to_string().increment().unwrap());
use increment::*;
assert_eq!(IncResult::OutOfBounds, u128::max_value().to_string().increment());