Struct bonsaidb_core::key::EscapeNullBytes
source · pub struct EscapeNullBytes;
Expand description
Escapes null bytes in variable length fields in composite keys. This option ensures proper sort order is maintained even when null bytes are used within vairable fields.
To see more information about the edge case encoding prevents, see
CompositeKeyFieldContainsNullByte
.
Trait Implementations§
source§impl Clone for EscapeNullBytes
impl Clone for EscapeNullBytes
source§fn clone(&self) -> EscapeNullBytes
fn clone(&self) -> EscapeNullBytes
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CompositeKeyNullHandler for EscapeNullBytes
impl CompositeKeyNullHandler for EscapeNullBytes
source§fn handle_nulls(
&self,
unescaped: &mut Cow<'_, [u8]>
) -> Result<(), CompositeKeyError>
fn handle_nulls( &self, unescaped: &mut Cow<'_, [u8]> ) -> Result<(), CompositeKeyError>
Process the null bytes in
field_bytes
, if needed.source§fn decode_nulls_if_needed<'b, 'e>(
&self,
encoded: ByteSource<'b, 'e>
) -> Result<ByteSource<'b, 'e>, CompositeKeyError>
fn decode_nulls_if_needed<'b, 'e>( &self, encoded: ByteSource<'b, 'e> ) -> Result<ByteSource<'b, 'e>, CompositeKeyError>
Decode the null bytes in
encoded
, if needed.source§impl Debug for EscapeNullBytes
impl Debug for EscapeNullBytes
source§impl Default for EscapeNullBytes
impl Default for EscapeNullBytes
source§fn default() -> EscapeNullBytes
fn default() -> EscapeNullBytes
Returns the “default value” for a type. Read more
impl Copy for EscapeNullBytes
Auto Trait Implementations§
impl RefUnwindSafe for EscapeNullBytes
impl Send for EscapeNullBytes
impl Sync for EscapeNullBytes
impl Unpin for EscapeNullBytes
impl UnwindSafe for EscapeNullBytes
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more