Function mz_persist_types::stats::truncate_bytes

source ·
pub fn truncate_bytes(
    x: &[u8],
    max_len: usize,
    bound: TruncateBound
) -> Option<Vec<u8>>
Expand description

Truncates a u8 slice to the given maximum byte length.

If bound is Lower, the returned value will sort <= the original value, and if bound is Upper, it will sort >= the original value.

Lower bounds will always return Some. Upper bounds might return None if the part that fits in max_len is entirely made of u8::MAX.