pub trait ColumnValue: Copy + PartialEq {
const IS_INTEGER: bool;
// Required methods
fn to_bits(self) -> u64;
fn from_bits(bits: u64) -> Option<Self>;
}Expand description
A value that can live in an encoded column.
Encodings work on the bit pattern, so anything with a lossless 64-bit representation qualifies. Bit-packing a float is legal and never chosen: the encoder’s rules only reach for it where the values are small integers.
Required Associated Constants§
Sourceconst IS_INTEGER: bool
const IS_INTEGER: bool
Whether the bit pattern is an integer, so that narrowing it or taking differences between successive values means something.
False for floating point. Bit-packing a float would sometimes succeed — small floats have leading zero bits — and would produce a column whose size depended on the exponents in it, which is not an encoding anyone chose.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".