Trait OverflowingAddAssign

Source
pub trait OverflowingAddAssign<RHS = Self> {
    // Required method
    fn overflowing_add_assign(&mut self, other: RHS) -> bool;
}
Expand description

Adds a number to another number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped number is assigned.

Required Methods§

Source

fn overflowing_add_assign(&mut self, other: RHS) -> bool

Implementations on Foreign Types§

Source§

impl OverflowingAddAssign for i8

Source§

fn overflowing_add_assign(&mut self, other: i8) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for i16

Source§

fn overflowing_add_assign(&mut self, other: i16) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for i32

Source§

fn overflowing_add_assign(&mut self, other: i32) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for i64

Source§

fn overflowing_add_assign(&mut self, other: i64) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for i128

Source§

fn overflowing_add_assign(&mut self, other: i128) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for isize

Source§

fn overflowing_add_assign(&mut self, other: isize) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for u8

Source§

fn overflowing_add_assign(&mut self, other: u8) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for u16

Source§

fn overflowing_add_assign(&mut self, other: u16) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for u32

Source§

fn overflowing_add_assign(&mut self, other: u32) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for u64

Source§

fn overflowing_add_assign(&mut self, other: u64) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for u128

Source§

fn overflowing_add_assign(&mut self, other: u128) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Source§

impl OverflowingAddAssign for usize

Source§

fn overflowing_add_assign(&mut self, other: usize) -> bool

Adds a number to another number, in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Implementors§