Skip to main content

apply

Function apply 

Source
pub fn apply<T: Clone, K: Eq + Hash>(
    a: &[T],
    b: &[T],
    ops: &[Op],
    key: impl Fn(&T) -> K,
) -> Result<Vec<T>, ScriptError>
Expand description

Applies a script to a, producing the new sequence. Kept and moved items are taken from a; inserted and replacement items from b. Fails if the script is invalid or pairs items whose keys differ, so on success the result’s keys equal b’s.