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

Trait marking types which are allowed to be keys or values in ZeroMap.

Users should not be calling methods of this trait directly, however if you are implementing your own AsULE or AsVarULE type you may wish to implement this trait.

Associated Types

The container that can be used with this type: ZeroVec or VarZeroVec.

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

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

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

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

Implementations on Foreign Types

Implementors