Enum repr::gen::row::proto_datum::DatumType [−][src]
pub enum DatumType {
Show 17 variants
Other(i32),
Int16(i32),
Int32(i32),
Int64(i64),
Float32(f32),
Float64(f64),
Bytes(Vec<u8>),
String(String),
Date(ProtoDate),
Time(ProtoTime),
Timestamp(ProtoTimestamp),
Interval(ProtoInterval),
Array(ProtoArray),
List(ProtoRow),
Dict(ProtoDict),
Numeric(ProtoNumeric),
Uuid(Vec<u8>),
}
Expand description
NB: Proto oneof ids 1..=15
get encoded in 1 byte and so we should
reserve them for the datum types we expect to be most popular.
Null, False, and True are all likely to be frequent, but the encoded length is exactly the same if they’re here or in ProtoDatumOther. In general, anything that can be encoded purely as a proto enum variant (i.e. doesn’t have a payload) is better off that way. If we run out of 1-byte encodings of ProtoDatumOther, we can always add ProtoDatumOther2.
Variants
Other(i32)
Tuple Fields
0: i32
Int16(i32)
Tuple Fields
0: i32
Int32(i32)
Tuple Fields
0: i32
Int64(i64)
Tuple Fields
0: i64
Float32(f32)
Tuple Fields
0: f32
Float64(f64)
Tuple Fields
0: f64
Bytes(Vec<u8>)
String(String)
Tuple Fields
0: String
Don’t use 9-15 without truly understanding the NB above.
Date(ProtoDate)
Tuple Fields
0: ProtoDate
These get encoded with 2 bytes for the oneof id. It’s a pretty easy and low-debt migration to “bless” one of these into having a 1-byte id (fill in the new field on write, but check if either field is set on read). However, once a 1-byte id is used, it’s gone forever, so we’re conservative in handing them out.
Of these, I’d guess Timestamp and UUID are probably the first ones we’d bless followed by Date and Time.
Time(ProtoTime)
Tuple Fields
0: ProtoTime
Timestamp(ProtoTimestamp)
Tuple Fields
Interval(ProtoInterval)
Tuple Fields
Array(ProtoArray)
Tuple Fields
0: ProtoArray
List(ProtoRow)
Tuple Fields
0: ProtoRow
Dict(ProtoDict)
Tuple Fields
0: ProtoDict
Numeric(ProtoNumeric)
Tuple Fields
0: ProtoNumeric
Uuid(Vec<u8>)
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DatumType
impl UnwindSafe for DatumType
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more