pub enum MapKey {
Bool(bool),
I32(i32),
I64(i64),
U32(u32),
U64(u64),
String(String),
}Available on crate feature
dynamic only.Expand description
A protobuf map key.
Variants are limited to those allowed by the proto spec: floats, bytes, and message/enum keys are forbidden.
Variants§
Bool(bool)
bool.
I32(i32)
int32 / sint32 / sfixed32.
I64(i64)
int64 / sint64 / sfixed64.
U32(u32)
uint32 / fixed32.
U64(u64)
uint64 / fixed64.
String(String)
string.
Implementations§
Source§impl MapKey
impl MapKey
Sourcepub fn default_value(kind: &Kind) -> Self
pub fn default_value(kind: &Kind) -> Self
The proto default for the given map-key kind.
§Panics
Panics if kind is not a legal map-key shape (floats, bytes,
messages, and enums are forbidden by the proto spec). The pool
builder rejects such map declarations, so this only fires for
hand-constructed misuse.
Trait Implementations§
Source§impl Ord for MapKey
impl Ord for MapKey
Source§impl PartialOrd for MapKey
impl PartialOrd for MapKey
impl Eq for MapKey
impl StructuralPartialEq for MapKey
Auto Trait Implementations§
impl Freeze for MapKey
impl RefUnwindSafe for MapKey
impl Send for MapKey
impl Sync for MapKey
impl Unpin for MapKey
impl UnsafeUnpin for MapKey
impl UnwindSafe for MapKey
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