Diffable

Trait Diffable 

Source
pub trait Diffable {
    type Diff<'daft>
       where Self: 'daft;

    // Required method
    fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>;
}
Expand description

Represents a type which can be diffed.

For more information, see the crate-level documentation.

Required Associated Types§

Source

type Diff<'daft> where Self: 'daft

The type of the diff.

This is a generic associated type, also known as a GAT. The 'daft lifetime is used in the diff method to ensure that the returned diff is valid for the lifetime of the input values.

Required Methods§

Source

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Compute the diff between two values.

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 IpAddr

Source§

type Diff<'daft> = Leaf<&'daft IpAddr>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for SocketAddr

Source§

type Diff<'daft> = Leaf<&'daft SocketAddr>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for IpNet

Available on crate feature oxnet01 only.
Source§

type Diff<'daft> = Leaf<&'daft IpNet>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for bool

Source§

type Diff<'daft> = Leaf<&'daft bool>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for char

Source§

type Diff<'daft> = Leaf<&'daft char>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for i8

Source§

type Diff<'daft> = Leaf<&'daft i8>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for i16

Source§

type Diff<'daft> = Leaf<&'daft i16>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for i32

Source§

type Diff<'daft> = Leaf<&'daft i32>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for i64

Source§

type Diff<'daft> = Leaf<&'daft i64>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for isize

Source§

type Diff<'daft> = Leaf<&'daft isize>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for str

Source§

type Diff<'daft> = Leaf<&'daft str>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for u8

Source§

type Diff<'daft> = Leaf<&'daft u8>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for u16

Source§

type Diff<'daft> = Leaf<&'daft u16>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for u32

Source§

type Diff<'daft> = Leaf<&'daft u32>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for u64

Source§

type Diff<'daft> = Leaf<&'daft u64>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for ()

Source§

type Diff<'daft> = Leaf<&'daft ()>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for usize

Source§

type Diff<'daft> = Leaf<&'daft usize>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for String

Available on crate feature alloc only.
Source§

type Diff<'daft> = Leaf<&'daft str>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for Ipv4Addr

Source§

type Diff<'daft> = Leaf<&'daft Ipv4Addr>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for Ipv6Addr

Source§

type Diff<'daft> = Leaf<&'daft Ipv6Addr>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for SocketAddrV4

Source§

type Diff<'daft> = Leaf<&'daft SocketAddrV4>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for SocketAddrV6

Source§

type Diff<'daft> = Leaf<&'daft SocketAddrV6>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for OsStr

Available on crate feature std only.
Source§

type Diff<'daft> = Leaf<&'daft OsStr>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for OsString

Available on crate feature std only.
Source§

type Diff<'daft> = Leaf<&'daft OsStr>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for Path

Available on crate feature std only.
Source§

type Diff<'daft> = Leaf<&'daft Path>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for PathBuf

Available on crate feature std only.
Source§

type Diff<'daft> = Leaf<&'daft Path>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for Ipv4Net

Available on crate feature oxnet01 only.
Source§

type Diff<'daft> = Leaf<&'daft Ipv4Net>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for Ipv6Net

Available on crate feature oxnet01 only.
Source§

type Diff<'daft> = Leaf<&'daft Ipv6Net>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for Uuid

Available on crate feature uuid1 only.
Source§

type Diff<'daft> = Leaf<&'daft Uuid>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroI8

Source§

type Diff<'daft> = Leaf<&'daft NonZero<i8>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroI16

Source§

type Diff<'daft> = Leaf<&'daft NonZero<i16>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroI32

Source§

type Diff<'daft> = Leaf<&'daft NonZero<i32>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroI64

Source§

type Diff<'daft> = Leaf<&'daft NonZero<i64>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroI128

Source§

type Diff<'daft> = Leaf<&'daft NonZero<i128>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroIsize

Source§

type Diff<'daft> = Leaf<&'daft NonZero<isize>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroU8

Source§

type Diff<'daft> = Leaf<&'daft NonZero<u8>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroU16

Source§

type Diff<'daft> = Leaf<&'daft NonZero<u16>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroU32

Source§

type Diff<'daft> = Leaf<&'daft NonZero<u32>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroU64

Source§

type Diff<'daft> = Leaf<&'daft NonZero<u64>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroU128

Source§

type Diff<'daft> = Leaf<&'daft NonZero<u128>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl Diffable for NonZeroUsize

Source§

type Diff<'daft> = Leaf<&'daft NonZero<usize>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<'a, T: Diffable + ?Sized> Diffable for &'a T

Source§

type Diff<'daft> = <T as Diffable>::Diff<'daft> where 'a: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<A: Diffable> Diffable for (A,)

Source§

type Diff<'daft> = (<A as Diffable>::Diff<'daft>,) where A: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<A: Diffable, B: Diffable> Diffable for (A, B)

Source§

type Diff<'daft> = (<A as Diffable>::Diff<'daft>, <B as Diffable>::Diff<'daft>) where A: 'daft, B: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<A: Diffable, B: Diffable, C: Diffable> Diffable for (A, B, C)

Source§

type Diff<'daft> = (<A as Diffable>::Diff<'daft>, <B as Diffable>::Diff<'daft>, <C as Diffable>::Diff<'daft>) where A: 'daft, B: 'daft, C: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<A: Diffable, B: Diffable, C: Diffable, D: Diffable> Diffable for (A, B, C, D)

Source§

type Diff<'daft> = (<A as Diffable>::Diff<'daft>, <B as Diffable>::Diff<'daft>, <C as Diffable>::Diff<'daft>, <D as Diffable>::Diff<'daft>) where A: 'daft, B: 'daft, C: 'daft, D: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<A: Diffable, B: Diffable, C: Diffable, D: Diffable, E: Diffable> Diffable for (A, B, C, D, E)

Source§

type Diff<'daft> = (<A as Diffable>::Diff<'daft>, <B as Diffable>::Diff<'daft>, <C as Diffable>::Diff<'daft>, <D as Diffable>::Diff<'daft>, <E as Diffable>::Diff<'daft>) where A: 'daft, B: 'daft, C: 'daft, D: 'daft, E: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<A: Diffable, B: Diffable, C: Diffable, D: Diffable, E: Diffable, F: Diffable> Diffable for (A, B, C, D, E, F)

Source§

type Diff<'daft> = (<A as Diffable>::Diff<'daft>, <B as Diffable>::Diff<'daft>, <C as Diffable>::Diff<'daft>, <D as Diffable>::Diff<'daft>, <E as Diffable>::Diff<'daft>, <F as Diffable>::Diff<'daft>) where A: 'daft, B: 'daft, C: 'daft, D: 'daft, E: 'daft, F: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<A: Diffable, B: Diffable, C: Diffable, D: Diffable, E: Diffable, F: Diffable, G: Diffable> Diffable for (A, B, C, D, E, F, G)

Source§

type Diff<'daft> = (<A as Diffable>::Diff<'daft>, <B as Diffable>::Diff<'daft>, <C as Diffable>::Diff<'daft>, <D as Diffable>::Diff<'daft>, <E as Diffable>::Diff<'daft>, <F as Diffable>::Diff<'daft>, <G as Diffable>::Diff<'daft>) where A: 'daft, B: 'daft, C: 'daft, D: 'daft, E: 'daft, F: 'daft, G: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<A: Diffable, B: Diffable, C: Diffable, D: Diffable, E: Diffable, F: Diffable, G: Diffable, H: Diffable> Diffable for (A, B, C, D, E, F, G, H)

Source§

type Diff<'daft> = (<A as Diffable>::Diff<'daft>, <B as Diffable>::Diff<'daft>, <C as Diffable>::Diff<'daft>, <D as Diffable>::Diff<'daft>, <E as Diffable>::Diff<'daft>, <F as Diffable>::Diff<'daft>, <G as Diffable>::Diff<'daft>, <H as Diffable>::Diff<'daft>) where A: 'daft, B: 'daft, C: 'daft, D: 'daft, E: 'daft, F: 'daft, G: 'daft, H: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<A: Diffable, B: Diffable, C: Diffable, D: Diffable, E: Diffable, F: Diffable, G: Diffable, H: Diffable, I: Diffable> Diffable for (A, B, C, D, E, F, G, H, I)

Source§

type Diff<'daft> = (<A as Diffable>::Diff<'daft>, <B as Diffable>::Diff<'daft>, <C as Diffable>::Diff<'daft>, <D as Diffable>::Diff<'daft>, <E as Diffable>::Diff<'daft>, <F as Diffable>::Diff<'daft>, <G as Diffable>::Diff<'daft>, <H as Diffable>::Diff<'daft>, <I as Diffable>::Diff<'daft>) where A: 'daft, B: 'daft, C: 'daft, D: 'daft, E: 'daft, F: 'daft, G: 'daft, H: 'daft, I: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<A: Diffable, B: Diffable, C: Diffable, D: Diffable, E: Diffable, F: Diffable, G: Diffable, H: Diffable, I: Diffable, J: Diffable> Diffable for (A, B, C, D, E, F, G, H, I, J)

Source§

type Diff<'daft> = (<A as Diffable>::Diff<'daft>, <B as Diffable>::Diff<'daft>, <C as Diffable>::Diff<'daft>, <D as Diffable>::Diff<'daft>, <E as Diffable>::Diff<'daft>, <F as Diffable>::Diff<'daft>, <G as Diffable>::Diff<'daft>, <H as Diffable>::Diff<'daft>, <I as Diffable>::Diff<'daft>, <J as Diffable>::Diff<'daft>) where A: 'daft, B: 'daft, C: 'daft, D: 'daft, E: 'daft, F: 'daft, G: 'daft, H: 'daft, I: 'daft, J: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<K: Ord + Eq> Diffable for BTreeSet<K>

Available on crate feature alloc only.
Source§

type Diff<'daft> = BTreeSetDiff<'daft, K> where K: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<K: Ord + Eq, V> Diffable for BTreeMap<K, V>

Available on crate feature alloc only.
Source§

type Diff<'daft> = BTreeMapDiff<'daft, K, V> where K: 'daft, V: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<K: Hash + Eq> Diffable for HashSet<K>

Available on crate feature std only.
Source§

type Diff<'daft> = HashSetDiff<'daft, K> where K: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<K: Hash + Eq, V> Diffable for HashMap<K, V>

Available on crate feature std only.
Source§

type Diff<'daft> = HashMapDiff<'daft, K, V> where K: 'daft, V: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T> Diffable for Option<T>

Source§

type Diff<'daft> = Leaf<Option<&'daft T>> where T: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T> Diffable for TypedUuid<T>

Available on crate feature newtype-uuid1 only.
Source§

type Diff<'daft> = Leaf<&'daft TypedUuid<T>>

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T, U> Diffable for Result<T, U>

Source§

type Diff<'daft> = Leaf<Result<&'daft T, &'daft U>> where T: 'daft, U: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T: Diffable + ToOwned + ?Sized> Diffable for Cow<'_, T>

Available on crate feature alloc only.
Source§

type Diff<'daft> = <T as Diffable>::Diff<'daft> where Self: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T: Diffable + ?Sized> Diffable for Box<T>

Available on crate feature alloc only.
Source§

type Diff<'daft> = <T as Diffable>::Diff<'daft> where T: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T: Diffable + ?Sized> Diffable for Rc<T>

Available on crate feature alloc only.
Source§

type Diff<'daft> = <T as Diffable>::Diff<'daft> where T: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T: Diffable + ?Sized> Diffable for Arc<T>

Available on crate feature alloc only.
Source§

type Diff<'daft> = <T as Diffable>::Diff<'daft> where T: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T: Diffable> Diffable for [T]

Treat slices as leaf nodes.

Source§

type Diff<'daft> = Leaf<&'daft [T]> where T: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T: Diffable> Diffable for Vec<T>

Available on crate feature alloc only.

Treat Vecs as Leafs

Source§

type Diff<'daft> = Leaf<&'daft [T]> where T: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T: ?Sized> Diffable for RefCell<T>

Source§

type Diff<'daft> = Leaf<&'daft RefCell<T>> where T: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Source§

impl<T: ?Sized> Diffable for PhantomData<T>

Source§

type Diff<'daft> = Leaf<&'daft PhantomData<T>> where Self: 'daft

Source§

fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>

Implementors§