Skip to main content

unsuffix

Function unsuffix 

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

Returns tuple of key and ion by splitting iokey at rightmost separator sep

§Parameters

  • iokey - actual database key with insertion ordering suffix
  • sep - separator character(s) (default is b’.’)

§Returns

  • Result<(Vec<u8>, u64), DBError> - tuple of apparent key and insertion ordering int

§Errors

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