pub(crate) fn map_key_bound_plus_ts<'a>(
    lower: Bound<&'a [u8]>,
    upper: Bound<&'a [u8]>,
    ts: u64,
) -> (Bound<KeySlice<'a>>, Bound<KeySlice<'a>>) {
    (
        match lower {
            Bound::Included(x) => Bound::Included(KeySlice::from_slice(x, ts)),
            Bound::Excluded(x) => Bound::Excluded(KeySlice::from_slice(x, TS_RANGE_END)),
            Bound::Unbounded => Bound::Unbounded,
        },
        match upper {
            Bound::Included(x) => {
                // Note that we order the ts descending, but for a MVCC scan, we need all the history
                // so that we can access the latest key in case it is not updated in the current ts.
                // Therefore, we need to scan all the way to ts 0.
                Bound::Included(KeySlice::from_slice(x, TS_RANGE_END))
            }
            Bound::Excluded(x) => Bound::Excluded(KeySlice::from_slice(x, TS_RANGE_BEGIN)),
            Bound::Unbounded => Bound::Unbounded,
        },
    )
}
Create a bound of `KeySlice` from a bound of `&[u8]`.
mini-lsm-mvcc/src/mem_table.rs