Skip to main content

Crate fionn_diff

Crate fionn_diff 

Source
Expand description

§JSON Diff/Patch/Merge

High-performance JSON structural operations with SIMD acceleration.

This module provides three related capabilities:

§JSON Diff

Generate a list of operations that transform one JSON document into another. Follows the spirit of RFC 6902 (JSON Patch) for the output format.

§JSON Patch (RFC 6902)

Apply a sequence of operations to a JSON document:

  • add: Insert a value at a path
  • remove: Delete a value at a path
  • replace: Replace a value at a path
  • move: Move a value from one path to another
  • copy: Copy a value from one path to another
  • test: Verify a value equals the expected value

§JSON Merge Patch (RFC 7396)

A simpler merge format where:

  • Objects are recursively merged
  • null values indicate deletion
  • Other values replace existing ones

§Performance

Uses SIMD acceleration for:

  • Bulk string comparison (detect unchanged strings quickly)
  • Array element comparison
  • Finding longest common subsequence in arrays

Structs§

CellChange
Change to a single cell
CsvDiff
Result of CSV diff
CsvDiffOptions
CSV diff options
CsvDiffStats
Statistics about a CSV diff
DiffOptions
Options for diff generation.
GenericDiffOptions
Options for diff computation
GenericPatch
A collection of patch operations (format-agnostic)
JsonPatch
A JSON Patch document (sequence of operations).
JsonPatchRef
A JSON Patch document with zero-copy operations.
StreamingMergeOptions
Options for streaming merge operations
TapeDiff
Result of diffing two tapes
TapeDiffOptions
Options for tape diff

Enums§

CsvDiffOp
A single CSV diff operation
DiffValueKind
Classification of value types for diff operations
GenericPatchError
Errors that can occur during patch application
GenericPatchOperation
A single patch operation (format-agnostic)
PatchError
Error type for patch operations.
PatchOperation
A single patch operation.
PatchOperationRef
A single patch operation with zero-copy paths where possible.
RowIdentityMode
How rows are identified for diff comparison
TapeDiffOp
A tape diff operation
TapeValueOwned
Owned tape value for patch operations

Traits§

DiffableValue
Trait for values that can be compared for diffing
Patchable
Trait for values that can have patches applied

Functions§

apply_patch
Apply a JSON Patch to a value, returning a new value.
apply_patch_mut
Apply a JSON Patch to a value in place.
apply_tape_diff
Apply a TapeDiff to a mutable value
csv_diff
Compute diff between two CSV representations
csv_diff_tapes
Compute diff between two TapeSource CSVs
deep_merge
Deep merge two objects, preferring values from overlay.
deep_merge_tape_into_value
Deep merge a tape onto an existing Value
deep_merge_tapes
Deep merge two tapes (preserves null values)
diff_tapes
Diff two tapes and produce a patch
diff_tapes_with_options
Diff two tapes with custom options
generic_apply_operation
Apply a single operation to a value
generic_apply_patch
Apply a patch to a value
generic_compute_diff
Compute a diff between two values
generic_compute_diff_with_options
Compute a diff with custom options
json_diff
Generate a JSON Patch that transforms source into target.
json_diff_with_options
Generate a JSON Patch with custom options.
json_diff_zerocopy
Generate a zero-copy JSON Patch that transforms source into target.
json_merge_patch
Apply a JSON Merge Patch (RFC 7396) to a document.
json_numbers_equal
Compare two JSON number representations for equality.
json_strings_equal
Compare two JSON string values for equality.
merge_many
Merge multiple JSON documents using merge patch semantics.
merge_many_tapes
Merge multiple tapes left-to-right using RFC 7396 semantics
merge_patch_to_value
Generate a merge patch from two JSON documents.
merge_tape_into_value
Merge a tape onto an existing Value
merge_tapes
Merge two tapes using RFC 7396 (JSON Merge Patch) semantics
patch_tape
Full pipeline: apply diff from tape_b to value derived from tape_a
simd_bytes_equal
SIMD-accelerated byte slice equality check.
simd_find_first_difference
Find the first position where two byte slices differ.
streaming_merge
Streaming merge that can be interrupted/resumed
tape_to_value
Convert a tape to a serde_json::Value
three_way_patch
Three-way patch: apply diff to a tape and return as Value
value_to_json
Serialize a value back to JSON string
value_to_json_pretty
Serialize a value back to pretty JSON string