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>)

Tuple Fields

0: Vec<u8>

String(String)

Tuple Fields

0: String

Don’t use 9-15 without truly understanding the NB above.

Date(ProtoDate)

Tuple Fields

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

Timestamp(ProtoTimestamp)

Tuple Fields

Interval(ProtoInterval)

Tuple Fields

Array(ProtoArray)

Tuple Fields

List(ProtoRow)

Tuple Fields

Dict(ProtoDict)

Tuple Fields

Numeric(ProtoNumeric)

Tuple Fields

Uuid(Vec<u8>)

Tuple Fields

0: Vec<u8>

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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