pub fn process_patch<F, G>(
patch: &SyncdPatch,
state: &mut HashState,
get_keys: F,
get_prev_value_mac: G,
validate_macs: bool,
collection_name: &str,
) -> Result<PatchProcessingResult, AppStateError>where
F: FnMut(&[u8]) -> Result<ExpandedAppStateKeys, AppStateError>,
G: FnMut(&[u8]) -> Result<Option<Vec<u8>>, AppStateError>,Expand description
Process a single patch and decode its mutations.
This is a pure, synchronous function that processes a patch without any async operations. Key and previous value lookup are done via callbacks.
§Arguments
patch- The patch to processstate- The current hash state (will be mutated in place)get_keys- Callback to get expanded keys for a key IDget_prev_value_mac- Callback to get previous value MAC for an index MACvalidate_macs- Whether to validate MACs during processingcollection_name- The collection name (for MAC validation)
§Returns
A PatchProcessingResult containing the new state and decoded mutations.