Expand description
A trait to diff and apply diffs between two structs
The derive macro can be used on structs when all fields of the struct implement Diff
Implementations are provided for bools, numeric types, Option types, and HashMaps
The type associated with the structs’ difference
Produces a diff between two structs
Applies the diff directly to the struct
The identity element of the struct
use diff::Diff;
let s = 42;
let i = <i32 as Diff>::identity();
assert_eq!(i.apply_new(&i.diff(&s)), s);
or mathematically speaking, i + (s - i) = s
Produces a diff between two structs, using an external diffing implementation
Applies the diff directly to the struct, using an external diffing implementation
Applies the diff to the struct and produces a new struct
Applies the diff to the struct and produces a new struct, using an external diffing implementation
impl<A, B, C, D> Diff for (A, B, C, D) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
impl<A, B, C, D, F> Diff for (A, B, C, D, F) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
impl<A, B, C, D, F, G> Diff for (A, B, C, D, F, G) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
impl<A, B, C, D, F, G, H> Diff for (A, B, C, D, F, G, H) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
impl<A, B, C, D, F, G, H, I> Diff for (A, B, C, D, F, G, H, I) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
impl<A, B, C, D, F, G, H, I, J> Diff for (A, B, C, D, F, G, H, I, J) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
J: Diff,
impl<A, B, C, D, F, G, H, I, J, K> Diff for (A, B, C, D, F, G, H, I, J, K) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
J: Diff,
K: Diff,
impl<A, B, C, D, F, G, H, I, J, K, L> Diff for (A, B, C, D, F, G, H, I, J, K, L) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
J: Diff,
K: Diff,
L: Diff,
impl<A, B, C, D, F, G, H, I, J, K, L, M> Diff for (A, B, C, D, F, G, H, I, J, K, L, M) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
J: Diff,
K: Diff,
L: Diff,
M: Diff,
impl<A, B, C, D, F, G, H, I, J, K, L, M, N> Diff for (A, B, C, D, F, G, H, I, J, K, L, M, N) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
J: Diff,
K: Diff,
L: Diff,
M: Diff,
N: Diff,
impl<A, B, C, D, F, G, H, I, J, K, L, M, N, O> Diff for (A, B, C, D, F, G, H, I, J, K, L, M, N, O) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
J: Diff,
K: Diff,
L: Diff,
M: Diff,
N: Diff,
O: Diff,
impl<A, B, C, D, F, G, H, I, J, K, L, M, N, O, P> Diff for (A, B, C, D, F, G, H, I, J, K, L, M, N, O, P) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
J: Diff,
K: Diff,
L: Diff,
M: Diff,
N: Diff,
O: Diff,
P: Diff,
impl<A, B, C, D, F, G, H, I, J, K, L, M, N, O, P, Q> Diff for (A, B, C, D, F, G, H, I, J, K, L, M, N, O, P, Q) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
J: Diff,
K: Diff,
L: Diff,
M: Diff,
N: Diff,
O: Diff,
P: Diff,
Q: Diff,
impl<A, B, C, D, F, G, H, I, J, K, L, M, N, O, P, Q, R> Diff for (A, B, C, D, F, G, H, I, J, K, L, M, N, O, P, Q, R) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
J: Diff,
K: Diff,
L: Diff,
M: Diff,
N: Diff,
O: Diff,
P: Diff,
Q: Diff,
R: Diff,
impl<A, B, C, D, F, G, H, I, J, K, L, M, N, O, P, Q, R, S> Diff for (A, B, C, D, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) where
A: Diff,
B: Diff,
C: Diff,
D: Diff,
F: Diff,
G: Diff,
H: Diff,
I: Diff,
J: Diff,
K: Diff,
L: Diff,
M: Diff,
N: Diff,
O: Diff,
P: Diff,
Q: Diff,
R: Diff,
S: Diff,