Function smdiff_merger::get_exact_slice

source ·
pub fn get_exact_slice(
    ops: &[SparseOp],
    start: u64,
    len: u32,
) -> Option<Vec<SparseOp>>
Expand description

Returns a cloned and clipped subslice of ops that exactly covers the requested output range.

§Arguments

  • ops - The list of ops to extract from.
  • start - The output position (output byte offset) to start the slice at.
  • len - The length of the slice in output bytes.

§Returns

A vector containing the cloned and clipped ops that exactly cover the requested output range. If the output range is not covered by the ops, None is returned.

This does not check that the ops are sequential.