pub struct RecordKey /* private fields */ Implementations
pub fn routing_hash(&self) -> u64
The hash that selects the shard, valid once RecordKey::compute_hashes has run.
pub fn compute_hashes(&mut self)
Appends a null value of a type whose encoding is width bytes wide: that many zero bytes.
Appends a boolean value (1 byte: 1 for true, 0 for false).
pub fn push_string(&mut self, val: &str)
pub fn push_timestamp(&mut self, millis: i64)
Appends a timestamp value (milliseconds since Unix epoch) as 8 bytes packed datetime.
Encoding (64 bits):
- Bits 53-63: year-1900 (11 bits)
- Bits 49-52: month (4 bits)
- Bits 44-48: day (5 bits)
- Bits 39-43: hour (5 bits)
- Bits 33-38: minute (6 bits)
- Bits 27-32: second (6 bits)
- Bits 17-26: millisecond (10 bits)
- Bits 8-16: day of year (9 bits)
- Bits 5-7: day of week (3 bits)
pub fn push_datetime(&mut self, val: &str)
Appends a datetime value from string format “YYYY-MM-DD HH:MM:SS.mmm”
Appends a time value from string format “HH:MM:SS.mmm”
Encoding (32 bits):
- Bits 26-31: hour (6 bits)
- Bits 20-25: minute (6 bits)
- Bits 14-19: second (6 bits)
- Bits 4-13: millisecond (10 bits)
Appends a UUID value from string format “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”
Encoding (16 bytes) - special little-endian packing:
- Bytes 0-3: Last 8 hex digits of last group (reversed)
- Bytes 4-5: First 4 hex digits of last group (reversed)
- Bytes 6-7: Fourth group (reversed)
- Bytes 8-9: Third group (reversed)
- Bytes 10-11: Second group (reversed)
- Bytes 12-15: First group (reversed)
pub fn push_ulong(&mut self, val: &str) -> Result<(), KineticaError>
Appends an unsigned long given as text: the value’s low 64 bits, little-endian like every other number in the key.
The text must be one to twenty digits, or this writes nothing and fails. That check is of the form, not the range, so a twenty-digit value above u64::MAX passes and keeps only its low 64 bits.
Only ASCII digits are accepted, as for a look-up filter (see RecordKeyBuilder::build_expression). The server refuses other digits too (“invalid ulong”), so such a record fails either way; here it fails before it is sent.
Appends a decimal value given as text: the text is parsed as an exact decimal and rounded HALF_UP to scale, and text that is not a number, or is wider than precision at that scale, encodes as zero. A precision of up to 18 takes 8 bytes and a wider one 12, both two’s complement.