daft 0.1.5

Structural diffs of Rust data structures
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Represents a type which can be diffed.
///
/// For more information, see the [crate-level documentation](crate).
pub trait Diffable {
    /// The type of the diff.
    ///
    /// This is a [generic associated type][GAT], 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.
    ///
    /// [GAT]: https://blog.rust-lang.org/2021/08/03/GATs-stabilization-push.html
    type Diff<'daft>
    where
        Self: 'daft;

    /// Compute the diff between two values.
    fn diff<'daft>(&'daft self, other: &'daft Self) -> Self::Diff<'daft>;
}