apply

Function apply 

Source
pub fn apply(state: &Value, ops: &[Op]) -> Result<Value, BadPatch>
Expand description

Apply a patch, in order.

Fails rather than guesses: a path that does not exist means the client and the server disagree about the state, and continuing from a state neither of them has is how a browser ends up rendering something that never happened. The subscription’s answer to a failure is the same as the log’s — ask for the whole value again (crate::render).