Skip to content

Conversation

@mariusae
Copy link
Member

@mariusae mariusae commented Nov 24, 2025

Stack from ghstack (oldest at bottom):

The crate struct_diff_patch provides "diff" and "patch" operations for rust data types. It defines two generic traits: 1) Diff which implements diffing two values to produce a patch; and 2) Patch which is implemented on patches in order to apply them to values.

Additionally, the crate provides a "watch", which lets subscribers track changes to a value as a value snapshot + stream of patches.

The intention is to use this in the monarch resource model to observe resources efficiently, without having to implement special operations for each access pattern.

In the future, we can also implement patch merge operations in order to allow patches to be used in accumulations as well.

Differential Revision: D87822791

The crate struct_diff_patch provides "diff" and "patch" operations for rust data types. It defines two generic traits: 1) `Diff` which implements diffing two values to produce a patch; and 2) `Patch` which is implemented on patches in order to apply them to values.

Additionally, the crate provides a "watch", which lets subscribers track changes to a value as a value snapshot + stream of patches.

The intention is to use this in the monarch resource model to observe resources efficiently, without having to implement special operations for each access pattern.

In the future, we can also implement patch _merge_ operations in order to allow patches to be used in accumulations as well.

Differential Revision: [D87822791](https://our.internmc.facebook.com/intern/diff/D87822791/)

[ghstack-poisoned]
mariusae added a commit that referenced this pull request Nov 24, 2025
The crate struct_diff_patch provides "diff" and "patch" operations for rust data types. It defines two generic traits: 1) `Diff` which implements diffing two values to produce a patch; and 2) `Patch` which is implemented on patches in order to apply them to values.

Additionally, the crate provides a "watch", which lets subscribers track changes to a value as a value snapshot + stream of patches.

The intention is to use this in the monarch resource model to observe resources efficiently, without having to implement special operations for each access pattern.

In the future, we can also implement patch _merge_ operations in order to allow patches to be used in accumulations as well.

Differential Revision: [D87822791](https://our.internmc.facebook.com/intern/diff/D87822791/)

ghstack-source-id: 325471593
Pull Request resolved: #1989
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 24, 2025
The crate struct_diff_patch provides "diff" and "patch" operations for rust data types. It defines two generic traits: 1) `Diff` which implements diffing two values to produce a patch; and 2) `Patch` which is implemented on patches in order to apply them to values.

Additionally, the crate provides a "watch", which lets subscribers track changes to a value as a value snapshot + stream of patches.

The intention is to use this in the monarch resource model to observe resources efficiently, without having to implement special operations for each access pattern.

In the future, we can also implement patch _merge_ operations in order to allow patches to be used in accumulations as well.

Differential Revision: [D87822791](https://our.internmc.facebook.com/intern/diff/D87822791/)

[ghstack-poisoned]
mariusae added a commit that referenced this pull request Nov 25, 2025
Pull Request resolved: #1989

The crate struct_diff_patch provides "diff" and "patch" operations for rust data types. It defines two generic traits: 1) `Diff` which implements diffing two values to produce a patch; and 2) `Patch` which is implemented on patches in order to apply them to values.

Additionally, the crate provides a "watch", which lets subscribers track changes to a value as a value snapshot + stream of patches.

The intention is to use this in the monarch resource model to observe resources efficiently, without having to implement special operations for each access pattern.

In the future, we can also implement patch _merge_ operations in order to allow patches to be used in accumulations as well.
ghstack-source-id: 325529472
@exported-using-ghexport

Differential Revision: [D87822791](https://our.internmc.facebook.com/intern/diff/D87822791/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants