Function pack_record

Source
pub fn pack_record<F>(
    msr: &MSRecord,
    record_handler: F,
    flags: MSControlFlags,
) -> MSResult<(usize, usize)>
where F: FnMut(&[u8]),
Expand description

Pack record data into miniSEED records.

Buffers containing the packed miniSEED records are passed to the record_handler closure. Returns on success a tuple where the first value is the number of totally packed records and the second value is the number of totally packed samples.

If flags has MSControlFlags::MSF_FLUSHDATA set, all of the record data will be packed into miniSEED records even though the last one will probably be smaller than requested or, in the case of miniSEED v2, unfilled. If flags has MSControlFlags::MSF_PACKVER2 set records are packed as miniSEED v2.