#[repr(i32)]pub enum Type {
Show 18 variants
Double = 1,
Float = 2,
Int64 = 3,
Uint64 = 4,
Int32 = 5,
Fixed64 = 6,
Fixed32 = 7,
Bool = 8,
String = 9,
Group = 10,
Message = 11,
Bytes = 12,
Uint32 = 13,
Enum = 14,
Sfixed32 = 15,
Sfixed64 = 16,
Sint32 = 17,
Sint64 = 18,
}
Variants§
Double = 1
0 is reserved for errors. Order is weird for historical reasons.
Float = 2
Int64 = 3
Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if negative values are likely.
Uint64 = 4
Int32 = 5
Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if negative values are likely.
Fixed64 = 6
Fixed32 = 7
Bool = 8
String = 9
Group = 10
Tag-delimited aggregate. Group type is deprecated and not supported in proto3. However, Proto3 implementations should still be able to parse the group wire format and treat group fields as unknown fields.
Message = 11
Length-delimited aggregate.
Bytes = 12
New in version 2.
Uint32 = 13
Enum = 14
Sfixed32 = 15
Sfixed64 = 16
Sint32 = 17
Uses ZigZag encoding.
Sint64 = 18
Uses ZigZag encoding.
Implementations§
Source§impl Type
impl Type
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.