Struct bonsaidb::core::key::EscapeNullBytes
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§
§impl Clone for EscapeNullBytes
impl Clone for EscapeNullBytes
§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 more§impl CompositeKeyNullHandler for EscapeNullBytes
impl CompositeKeyNullHandler for EscapeNullBytes
§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.§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.§impl Debug for EscapeNullBytes
impl Debug for EscapeNullBytes
§impl Default for EscapeNullBytes
impl Default for EscapeNullBytes
§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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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