Diffable

Trait Diffable 

Source
pub trait Diffable {
    type Repr: Changeable + Debug + for<'de> MySerialize<'de>;

    // Required method
    fn diff(&self, b: &Self) -> Self::Repr;
}
Expand description

Trait representing the ability to compute a difference between two objects.

Required Associated Types§

Source

type Repr: Changeable + Debug + for<'de> MySerialize<'de>

The type used to represent the difference between two objects.

Required Methods§

Source

fn diff(&self, b: &Self) -> Self::Repr

Computes the difference between self and another object of the same type.

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 Diffable for Value

Available on crate feature json_value only.
Source§

type Repr = ValueDiff

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for bool

Source§

type Repr = PrimitiveDiff<bool>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for f32

Source§

type Repr = PrimitiveDiff<f32>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for f64

Source§

type Repr = PrimitiveDiff<f64>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for i8

Source§

type Repr = PrimitiveDiff<i8>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for i16

Source§

type Repr = PrimitiveDiff<i16>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for i32

Source§

type Repr = PrimitiveDiff<i32>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for i64

Source§

type Repr = PrimitiveDiff<i64>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for i128

Source§

type Repr = PrimitiveDiff<i128>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for u8

Source§

type Repr = PrimitiveDiff<u8>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for u16

Source§

type Repr = PrimitiveDiff<u16>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for u32

Source§

type Repr = PrimitiveDiff<u32>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for u64

Source§

type Repr = PrimitiveDiff<u64>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for u128

Source§

type Repr = PrimitiveDiff<u128>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for String

Source§

type Repr = PrimitiveDiff<String>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl Diffable for Map<String, Value>

Available on crate feature json_value only.
Source§

type Repr = ValueMapDiff

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl<K, T> Diffable for BTreeMap<K, T>
where for<'de> K: Hash + Eq + Ord + Debug + Clone + MySerialize<'de>, for<'de> T: Diffable + Debug + Clone + MySerialize<'de>,

Source§

type Repr = BTreeMapDiff<K, T>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl<K, T> Diffable for HashMap<K, T>
where for<'de> K: Hash + Eq + Debug + Clone + MySerialize<'de>, for<'de> T: Diffable + Debug + Clone + MySerialize<'de>,

Source§

type Repr = HashMapDiff<K, T>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl<T> Diffable for Option<T>
where for<'de> T: Diffable + Clone + Debug + MySerialize<'de>,

Source§

type Repr = OptionDiff<T>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Source§

impl<T> Diffable for Vec<T>
where for<'de> T: Diffable + Debug + Clone + PartialEq + MySerialize<'de>,

Source§

type Repr = VecDiff<T>

Source§

fn diff(&self, b: &Self) -> Self::Repr

Implementors§