Skip to content

Support for Getting Info (Field and Value) from Diffs #34

@aarkue

Description

@aarkue

Hi, thanks for creating this crate, it's been a pleasure to use :)
However, for my use case I am running into some missing features of the generated Diff structs:
Retrieving the changed field name and value from a Diff (which, for example, has been deserialized using serde before).

With the debug_diff feature flag it's already possible to print such info out, but I need programmatic access it.

Example:

let diffs: Vec<<Example as StructDiff>::Diff> = first.diff(&second);
for diff in diffs {
  // Have diff.field() and diff.new_value() or something like this available here.
}

Could this be supported by this crate? Maybe also behind a feature flag?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions