Skip to main content

split_on_key

Function split_on_key 

Source
pub fn split_on_key(
    key: impl AsRef<[u8]>,
    sep: Option<[u8; 1]>,
) -> Result<(Vec<u8>, u64), DBError>
Expand description

Returns tuple of pre and int on from key

§Parameters

  • key - database key
  • sep - separator character. default is b’.’

§Returns

  • Result<(Vec<u8>, u64), DBError> - tuple of pre and ordinal number

§Errors

  • DBError::ValueError - if key cannot be split
  • DBError::ParseError - if the ordinal part cannot be parsed as hex