Trait zerovec::map::ZeroMapKV [−][src]
pub trait ZeroMapKV<'a>: Sized { type Container: ZeroVecLike<'a, Self, NeedleType = Self::NeedleType, GetType = Self::GetType> + Sized; type NeedleType: ?Sized; type GetType: ?Sized; type SerializeType: ?Sized; fn as_needle(&self) -> &Self::NeedleType; fn cmp_get(&self, g: &Self::GetType) -> Ordering; fn with_ser<R>(
g: &Self::GetType,
f: impl FnOnce(&Self::SerializeType) -> R
) -> R; }
Expand description
Associated Types
type Container: ZeroVecLike<'a, Self, NeedleType = Self::NeedleType, GetType = Self::GetType> + Sized
type Container: ZeroVecLike<'a, Self, NeedleType = Self::NeedleType, GetType = Self::GetType> + Sized
The container that can be used with this type: ZeroVec
or VarZeroVec
.
type NeedleType: ?Sized
type NeedleType: ?Sized
The type to use with Container::binary_search()
This type will be predetermined by the choice of Self::Container
The type produces by Container::get()
This type will be predetermined by the choice of Self::Container
type SerializeType: ?Sized
type SerializeType: ?Sized
The type to use whilst serializing. This may not necessarily be Self
, however it
must serialize to the exact same thing as Self
Required methods
fn as_needle(&self) -> &Self::NeedleType
fn as_needle(&self) -> &Self::NeedleType
Convert to a needle for searching
Compare this type with a Self::GetType
. This must produce the same result as
if g
were converted to Self
fn with_ser<R>(
g: &Self::GetType,
f: impl FnOnce(&Self::SerializeType) -> R
) -> R
fn with_ser<R>(
g: &Self::GetType,
f: impl FnOnce(&Self::SerializeType) -> R
) -> R
Obtain a version of this type suitable for serialization
This uses a callback because it’s not possible to return owned-or-borrowed types without GATs