pub trait KeyEncoding<K = Self>: Send + Sync {
    type Error: AnyError;

    const LENGTH: Option<usize>;

    // Required methods
    fn describe<Visitor>(visitor: &mut Visitor)
       where Visitor: KeyVisitor;
    fn as_ord_bytes(&self) -> Result<Cow<'_, [u8]>, Self::Error>;
}
Expand description

A trait that enables a type to convert itself into a memcmp-compatible sequence of bytes.

Required Associated Types§

type Error: AnyError

The error type that can be produced by either serialization or deserialization.

Required Associated Constants§

const LENGTH: Option<usize>

The size of the key, if constant. If this type doesn’t produce the same number of bytes for each value, this should be None.

Required Methods§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

Describes this type by invoking functions on visitor describing the key being encoded.

See the KeyVisitor trait for more information.

KeyDescription::for_key()/KeyDescription::for_encoding() are built-in functions

fn as_ord_bytes(&self) -> Result<Cow<'_, [u8]>, Self::Error>

Convert self into a Cow<'_, [u8]> containing bytes that are able to be compared via memcmp in a way that is comptaible with its own Ord implementation.

Implementations on Foreign Types§

§

impl KeyEncoding<SystemTime> for SystemTime

§

type Error = TimeError

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <SystemTime as KeyEncoding<SystemTime>>::Error>

§

impl<T1, T2, T3, T4, T5, T6, T7> KeyEncoding<(T1, T2, T3, T4, T5, T6, T7)> for (T1, T2, T3, T4, T5, T6, T7)where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>, T4: for<'k> Key<'k>, T5: for<'k> Key<'k>, T6: for<'k> Key<'k>, T7: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH, T4::LENGTH, T5::LENGTH, T6::LENGTH, T7::LENGTH) { (Some(t1), Some(t2), Some(t3), Some(t4), Some(t5), Some(t6), Some(t7)) => Some(t1 + t2 + t3 + t4 + t5 + t6 + t7 + 0), _ => None, }

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <(T1, T2, T3, T4, T5, T6, T7) as KeyEncoding<(T1, T2, T3, T4, T5, T6, T7)>>::Error>

§

impl<T1> KeyEncoding<(T1,)> for (T1,)where T1: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH,) { (Some(t1),) => Some(t1 + 0), _ => None, }

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <(T1,) as KeyEncoding<(T1,)>>::Error>

§

impl KeyEncoding<NonZeroIsize> for NonZeroIsize

§

type Error = Error

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroIsize as KeyEncoding<NonZeroIsize>>::Error>

§

impl KeyEncoding<i16> for i16

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<i16>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <i16 as KeyEncoding<i16>>::Error>

§

impl KeyEncoding<i32> for i32

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<i32>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <i32 as KeyEncoding<i32>>::Error>

§

impl KeyEncoding<Duration> for Duration

§

type Error = TimeError

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <Duration as KeyEncoding<Duration>>::Error>

§

impl<'a, 'k, K, KE> KeyEncoding<K> for &'a KEwhere KE: KeyEncoding<K> + PartialEq<KE> + ?Sized, K: Key<'k> + PartialEq<KE>,

§

type Error = <KE as KeyEncoding<K>>::Error

§

const LENGTH: Option<usize> = K::LENGTH

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <&'a KE as KeyEncoding<K>>::Error>

§

impl KeyEncoding<i64> for i64

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<i64>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <i64 as KeyEncoding<i64>>::Error>

§

impl KeyEncoding<u128> for u128

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<u128>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <u128 as KeyEncoding<u128>>::Error>

§

impl<'k> KeyEncoding<CowBytes<'k>> for &'k [u8]

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <&'k [u8] as KeyEncoding<CowBytes<'k>>>::Error>

§

impl KeyEncoding<i8> for i8

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<i8>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes(&self) -> Result<Cow<'_, [u8]>, <i8 as KeyEncoding<i8>>::Error>

§

impl KeyEncoding<NonZeroI8> for NonZeroI8

§

type Error = NonZeroKeyError

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<i8>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroI8 as KeyEncoding<NonZeroI8>>::Error>

§

impl<'k> KeyEncoding<Bytes> for &'k [u8]

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <&'k [u8] as KeyEncoding<Bytes>>::Error>

§

impl<'k> KeyEncoding<Cow<'k, [u8]>> for &'k [u8]

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <&'k [u8] as KeyEncoding<Cow<'k, [u8]>>>::Error>

§

impl KeyEncoding<NonZeroI64> for NonZeroI64

§

type Error = NonZeroKeyError

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<i64>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroI64 as KeyEncoding<NonZeroI64>>::Error>

§

impl<'k> KeyEncoding<Vec<u8, Global>> for &'k [u8]

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <&'k [u8] as KeyEncoding<Vec<u8, Global>>>::Error>

§

impl KeyEncoding<NonZeroU64> for NonZeroU64

§

type Error = NonZeroKeyError

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<u64>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroU64 as KeyEncoding<NonZeroU64>>::Error>

§

impl KeyEncoding<NonZeroU128> for NonZeroU128

§

type Error = NonZeroKeyError

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<u128>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroU128 as KeyEncoding<NonZeroU128>>::Error>

§

impl<T1, T2, T3, T4, T5> KeyEncoding<(T1, T2, T3, T4, T5)> for (T1, T2, T3, T4, T5)where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>, T4: for<'k> Key<'k>, T5: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH, T4::LENGTH, T5::LENGTH) { (Some(t1), Some(t2), Some(t3), Some(t4), Some(t5)) => Some(t1 + t2 + t3 + t4 + t5 + 0), _ => None, }

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <(T1, T2, T3, T4, T5) as KeyEncoding<(T1, T2, T3, T4, T5)>>::Error>

§

impl KeyEncoding<NonZeroI16> for NonZeroI16

§

type Error = NonZeroKeyError

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<i16>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroI16 as KeyEncoding<NonZeroI16>>::Error>

§

impl<'k, 'ke> KeyEncoding<Cow<'ke, [u8]>> for Cow<'k, [u8]>

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <Cow<'k, [u8]> as KeyEncoding<Cow<'ke, [u8]>>>::Error>

§

impl KeyEncoding<String> for String

§

type Error = FromUtf8Error

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <String as KeyEncoding<String>>::Error>

§

impl KeyEncoding<u32> for u32

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<u32>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <u32 as KeyEncoding<u32>>::Error>

§

impl<T1, T2> KeyEncoding<(T1, T2)> for (T1, T2)where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH) { (Some(t1), Some(t2)) => Some(t1 + t2 + 0), _ => None, }

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <(T1, T2) as KeyEncoding<(T1, T2)>>::Error>

§

impl KeyEncoding<NonZeroU8> for NonZeroU8

§

type Error = NonZeroKeyError

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<u8>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroU8 as KeyEncoding<NonZeroU8>>::Error>

§

impl<T1, T2, T3> KeyEncoding<(T1, T2, T3)> for (T1, T2, T3)where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH) { (Some(t1), Some(t2), Some(t3)) => Some(t1 + t2 + t3 + 0), _ => None, }

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <(T1, T2, T3) as KeyEncoding<(T1, T2, T3)>>::Error>

§

impl KeyEncoding<()> for ()

§

type Error = Infallible

§

const LENGTH: Option<usize> = Some(0)

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes(&self) -> Result<Cow<'_, [u8]>, <() as KeyEncoding<()>>::Error>

§

impl KeyEncoding<bool> for bool

§

type Error = Infallible

§

const LENGTH: Option<usize> = Some(1)

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <bool as KeyEncoding<bool>>::Error>

§

impl<'k> KeyEncoding<ArcBytes<'k>> for &'k [u8]

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <&'k [u8] as KeyEncoding<ArcBytes<'k>>>::Error>

§

impl KeyEncoding<Uuid> for Uuid

§

type Error = TryFromSliceError

§

const LENGTH: Option<usize> = Some(16)

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <Uuid as KeyEncoding<Uuid>>::Error>

§

impl<const N: usize> KeyEncoding<[u8; N]> for [u8; N]

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(N)

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <[u8; N] as KeyEncoding<[u8; N]>>::Error>

§

impl<'k, T, E, TBorrowed, EBorrowed> KeyEncoding<Result<T, E>> for Result<TBorrowed, EBorrowed>where TBorrowed: KeyEncoding<T>, T: Key<'k, Error = <TBorrowed as KeyEncoding<T>>::Error>, EBorrowed: KeyEncoding<E, Error = <TBorrowed as KeyEncoding<T>>::Error>, E: Key<'k, Error = <TBorrowed as KeyEncoding<T>>::Error>,

§

type Error = <TBorrowed as KeyEncoding<T>>::Error

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <Result<TBorrowed, EBorrowed> as KeyEncoding<Result<T, E>>>::Error>

§

impl<T1, T2, T3, T4, T5, T6, T7, T8> KeyEncoding<(T1, T2, T3, T4, T5, T6, T7, T8)> for (T1, T2, T3, T4, T5, T6, T7, T8)where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>, T4: for<'k> Key<'k>, T5: for<'k> Key<'k>, T6: for<'k> Key<'k>, T7: for<'k> Key<'k>, T8: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH, T4::LENGTH, T5::LENGTH, T6::LENGTH, T7::LENGTH, T8::LENGTH) { (Some(t1), Some(t2), Some(t3), Some(t4), Some(t5), Some(t6), Some(t7), Some(t8)) => Some(t1 + t2 + t3 + t4 + t5 + t6 + t7 + t8 + 0), _ => None, }

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <(T1, T2, T3, T4, T5, T6, T7, T8) as KeyEncoding<(T1, T2, T3, T4, T5, T6, T7, T8)>>::Error>

§

impl KeyEncoding<NonZeroU16> for NonZeroU16

§

type Error = NonZeroKeyError

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<u16>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroU16 as KeyEncoding<NonZeroU16>>::Error>

§

impl KeyEncoding<NonZeroU32> for NonZeroU32

§

type Error = NonZeroKeyError

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<u32>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroU32 as KeyEncoding<NonZeroU32>>::Error>

§

impl<T1, T2, T3, T4> KeyEncoding<(T1, T2, T3, T4)> for (T1, T2, T3, T4)where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>, T4: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH, T4::LENGTH) { (Some(t1), Some(t2), Some(t3), Some(t4)) => Some(t1 + t2 + t3 + t4 + 0), _ => None, }

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <(T1, T2, T3, T4) as KeyEncoding<(T1, T2, T3, T4)>>::Error>

§

impl KeyEncoding<u64> for u64

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<u64>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <u64 as KeyEncoding<u64>>::Error>

§

impl KeyEncoding<NonZeroUsize> for NonZeroUsize

§

type Error = Error

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroUsize as KeyEncoding<NonZeroUsize>>::Error>

§

impl KeyEncoding<NonZeroI32> for NonZeroI32

§

type Error = NonZeroKeyError

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<i32>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroI32 as KeyEncoding<NonZeroI32>>::Error>

§

impl KeyEncoding<u8> for u8

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<u8>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes(&self) -> Result<Cow<'_, [u8]>, <u8 as KeyEncoding<u8>>::Error>

§

impl KeyEncoding<i128> for i128

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<i128>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <i128 as KeyEncoding<i128>>::Error>

§

impl KeyEncoding<isize> for isize

§

type Error = Error

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <isize as KeyEncoding<isize>>::Error>

§

impl KeyEncoding<String> for str

§

type Error = FromUtf8Error

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <str as KeyEncoding<String>>::Error>

§

impl KeyEncoding<NonZeroI128> for NonZeroI128

§

type Error = NonZeroKeyError

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<i128>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <NonZeroI128 as KeyEncoding<NonZeroI128>>::Error>

§

impl<'k, T, K> KeyEncoding<Option<K>> for Option<T>where T: KeyEncoding<K>, K: Key<'k>,

§

type Error = <T as KeyEncoding<K>>::Error

§

const LENGTH: Option<usize> = match T::LENGTH { Some(length) => Some(1 + length), None => None, }

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <Option<T> as KeyEncoding<Option<K>>>::Error>

§

impl KeyEncoding<Vec<u8, Global>> for Vec<u8, Global>

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <Vec<u8, Global> as KeyEncoding<Vec<u8, Global>>>::Error>

§

impl KeyEncoding<usize> for usize

§

type Error = Error

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <usize as KeyEncoding<usize>>::Error>

§

impl KeyEncoding<u16> for u16

§

type Error = IncorrectByteLength

§

const LENGTH: Option<usize> = Some(std::mem::size_of::<u16>())

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <u16 as KeyEncoding<u16>>::Error>

§

impl<T1, T2, T3, T4, T5, T6> KeyEncoding<(T1, T2, T3, T4, T5, T6)> for (T1, T2, T3, T4, T5, T6)where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>, T4: for<'k> Key<'k>, T5: for<'k> Key<'k>, T6: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH, T4::LENGTH, T5::LENGTH, T6::LENGTH) { (Some(t1), Some(t2), Some(t3), Some(t4), Some(t5), Some(t6)) => Some(t1 + t2 + t3 + t4 + t5 + t6 + 0), _ => None, }

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <(T1, T2, T3, T4, T5, T6) as KeyEncoding<(T1, T2, T3, T4, T5, T6)>>::Error>

§

impl<'k> KeyEncoding<Cow<'k, str>> for Cow<'k, str>

§

type Error = Utf8Error

§

const LENGTH: Option<usize> = None

§

fn describe<Visitor>(visitor: &mut Visitor)where Visitor: KeyVisitor,

§

fn as_ord_bytes( &self ) -> Result<Cow<'_, [u8]>, <Cow<'k, str> as KeyEncoding<Cow<'k, str>>>::Error>

Implementors§

§

impl KeyEncoding<Bytes> for Bytes

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

impl KeyEncoding<SensitiveBytes> for SensitiveBytes

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

impl KeyEncoding<SensitiveString> for SensitiveString

§

impl KeyEncoding<Timestamp> for Timestamp

§

impl KeyEncoding<Signed> for Signed

§

type Error = Error

§

const LENGTH: Option<usize> = None

§

impl KeyEncoding<Unsigned> for Unsigned

§

type Error = Error

§

const LENGTH: Option<usize> = None

§

impl<'a, 'k, TOwned, TBorrowed> KeyEncoding<MaybeOwned<'a, TOwned, TBorrowed>> for MaybeOwned<'a, TOwned, TBorrowed>where TBorrowed: KeyEncoding<TOwned, Error = <TOwned as KeyEncoding<TOwned>>::Error> + PartialEq<TBorrowed> + ?Sized, TOwned: Key<'k> + PartialEq<TBorrowed>,

§

type Error = <TOwned as KeyEncoding<TOwned>>::Error

§

const LENGTH: Option<usize> = TBorrowed::LENGTH

§

impl<'k> KeyEncoding<CowBytes<'k>> for CowBytes<'k>

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

impl<'k> KeyEncoding<ArcBytes<'k>> for ArcBytes<'k>

§

type Error = Infallible

§

const LENGTH: Option<usize> = None

§

impl<K, T> KeyEncoding<OptionKeyV1<K>> for OptionKeyV1<T>where T: KeyEncoding<K>, K: for<'k> Key<'k>,

§

type Error = <T as KeyEncoding<K>>::Error

§

const LENGTH: Option<usize> = T::LENGTH

§

impl<PrimaryKey> KeyEncoding<PrimaryKey> for DocumentIdwhere PrimaryKey: for<'pk> Key<'pk>,

§

type Error = Error

§

const LENGTH: Option<usize> = None

§

impl<Resolution> KeyEncoding<LimitedResolutionDuration<Resolution>> for LimitedResolutionDuration<Resolution>where Resolution: TimeResolution,

§

type Error = TimeError

§

const LENGTH: Option<usize> = None

§

impl<Resolution, Epoch> KeyEncoding<LimitedResolutionTimestamp<Resolution, Epoch>> for LimitedResolutionTimestamp<Resolution, Epoch>where Resolution: TimeResolution, Epoch: TimeEpoch,

§

type Error = TimeError

§

const LENGTH: Option<usize> = None

§

impl<T1> KeyEncoding<TupleEncodingV1<(T1,)>> for TupleEncodingV1<(T1,)>where T1: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH,) { (Some(t1),) => Some(t1 + 0), _ => None, }

§

impl<T1, T2> KeyEncoding<TupleEncodingV1<(T1, T2)>> for TupleEncodingV1<(T1, T2)>where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH) { (Some(t1), Some(t2)) => Some(t1 + t2 + 0), _ => None, }

§

impl<T1, T2, T3> KeyEncoding<TupleEncodingV1<(T1, T2, T3)>> for TupleEncodingV1<(T1, T2, T3)>where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH) { (Some(t1), Some(t2), Some(t3)) => Some(t1 + t2 + t3 + 0), _ => None, }

§

impl<T1, T2, T3, T4> KeyEncoding<TupleEncodingV1<(T1, T2, T3, T4)>> for TupleEncodingV1<(T1, T2, T3, T4)>where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>, T4: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH, T4::LENGTH) { (Some(t1), Some(t2), Some(t3), Some(t4)) => Some(t1 + t2 + t3 + t4 + 0), _ => None, }

§

impl<T1, T2, T3, T4, T5> KeyEncoding<TupleEncodingV1<(T1, T2, T3, T4, T5)>> for TupleEncodingV1<(T1, T2, T3, T4, T5)>where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>, T4: for<'k> Key<'k>, T5: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH, T4::LENGTH, T5::LENGTH) { (Some(t1), Some(t2), Some(t3), Some(t4), Some(t5)) => Some(t1 + t2 + t3 + t4 + t5 + 0), _ => None, }

§

impl<T1, T2, T3, T4, T5, T6> KeyEncoding<TupleEncodingV1<(T1, T2, T3, T4, T5, T6)>> for TupleEncodingV1<(T1, T2, T3, T4, T5, T6)>where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>, T4: for<'k> Key<'k>, T5: for<'k> Key<'k>, T6: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH, T4::LENGTH, T5::LENGTH, T6::LENGTH) { (Some(t1), Some(t2), Some(t3), Some(t4), Some(t5), Some(t6)) => Some(t1 + t2 + t3 + t4 + t5 + t6 + 0), _ => None, }

§

impl<T1, T2, T3, T4, T5, T6, T7> KeyEncoding<TupleEncodingV1<(T1, T2, T3, T4, T5, T6, T7)>> for TupleEncodingV1<(T1, T2, T3, T4, T5, T6, T7)>where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>, T4: for<'k> Key<'k>, T5: for<'k> Key<'k>, T6: for<'k> Key<'k>, T7: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH, T4::LENGTH, T5::LENGTH, T6::LENGTH, T7::LENGTH) { (Some(t1), Some(t2), Some(t3), Some(t4), Some(t5), Some(t6), Some(t7)) => Some(t1 + t2 + t3 + t4 + t5 + t6 + t7 + 0), _ => None, }

§

impl<T1, T2, T3, T4, T5, T6, T7, T8> KeyEncoding<TupleEncodingV1<(T1, T2, T3, T4, T5, T6, T7, T8)>> for TupleEncodingV1<(T1, T2, T3, T4, T5, T6, T7, T8)>where T1: for<'k> Key<'k>, T2: for<'k> Key<'k>, T3: for<'k> Key<'k>, T4: for<'k> Key<'k>, T5: for<'k> Key<'k>, T6: for<'k> Key<'k>, T7: for<'k> Key<'k>, T8: for<'k> Key<'k>,

§

type Error = CompositeKeyError

§

const LENGTH: Option<usize> = match (T1::LENGTH, T2::LENGTH, T3::LENGTH, T4::LENGTH, T5::LENGTH, T6::LENGTH, T7::LENGTH, T8::LENGTH) { (Some(t1), Some(t2), Some(t3), Some(t4), Some(t5), Some(t6), Some(t7), Some(t8)) => Some(t1 + t2 + t3 + t4 + t5 + t6 + t7 + t8 + 0), _ => None, }

§

impl<T> KeyEncoding<EnumKey<T>> for EnumKey<T>where T: ToPrimitive + FromPrimitive + Clone + Eq + Ord + Debug + Send + Sync,

§

type Error = Error

§

const LENGTH: Option<usize> = None

§

impl<T> KeyEncoding<VarInt<T>> for VarInt<T>where T: VariableInteger,

§

type Error = Error

§

const LENGTH: Option<usize> = None