IncrementDecrementMutator

Trait IncrementDecrementMutator 

Source
pub(crate) trait IncrementDecrementMutator:
    Sized
    + Copy
    + Debug {
    const ONE: Self;

    // Required methods
    fn validate(old: Self, new: Self, size: usize) -> Option<Self>;
    fn wrapping_add(self, rhs: Self) -> Self;
    fn wrapping_sub(self, rhs: Self) -> Self;

    // Provided method
    fn increment_decrement(
        self,
        size: usize,
        test_runner: &mut TestRunner,
    ) -> Option<Self> { ... }
}
Expand description

Mutator that randomly increments or decrements an uint or int.

Required Associated Constants§

Source

const ONE: Self

Required Methods§

Source

fn validate(old: Self, new: Self, size: usize) -> Option<Self>

Source

fn wrapping_add(self, rhs: Self) -> Self

Source

fn wrapping_sub(self, rhs: Self) -> Self

Provided Methods§

Source

fn increment_decrement( self, size: usize, test_runner: &mut TestRunner, ) -> Option<Self>

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 IncrementDecrementMutator for I256

Source§

const ONE: Self = Self::ONE

Source§

fn validate(old: Self, new: Self, size: usize) -> Option<Self>

Source§

fn wrapping_add(self, rhs: Self) -> Self

Source§

fn wrapping_sub(self, rhs: Self) -> Self

Source§

impl IncrementDecrementMutator for U256

Source§

const ONE: Self = Self::ONE

Source§

fn validate(old: Self, new: Self, size: usize) -> Option<Self>

Source§

fn wrapping_add(self, rhs: Self) -> Self

Source§

fn wrapping_sub(self, rhs: Self) -> Self

Implementors§