[Rust][Connector] Adding status reporters and if_modified
pattern
#997
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR:
*_if_modified
pattern that enables conditional status reporting by calling a user-provided closure with current status, only performing network operations when the closure returnsSome(new_status)
, optimizing performance by avoiding unnecessary API calls when status hasn't changedDeviceEndpointStatusReporter
, a clonable struct obtained from theDeviceEndpointClient
that can report the status of both the device and the endpoint viareport_device_status_if_modified
andreport_endpoint_status_if_modified
AssetStatusReporter
, a clonable struct obtained from theAssetClient
that can report the status of both the device and the endpoint viareport_device_status_if_modified
andreport_endpoint_status_if_modified
DataOperationStatusReporter
, a clonable struct obtained from theDataOperationClient
that can report the status of both the device and the endpoint viareport_status_if_modified
get_status_reporter
report_message_schema_reference_if_modified
andreport_message_schema_if_modified
which differ from the status reporting by providing the current message schema reference.base_connector_sample
for testing new*if_modified
functionality and associated CRDs