Encode as 18 bytes in big-endian order for stable byte-comparable sort. Layout: `physical_ms` (8 bytes) | `logical` (2 bytes) | `replica_id` (8 bytes).
(&self)
| 81 | /// |
| 82 | /// Layout: `physical_ms` (8 bytes) | `logical` (2 bytes) | `replica_id` (8 bytes). |
| 83 | pub fn to_bytes(&self) -> [u8; 18] { |
| 84 | let mut out = [0u8; 18]; |
| 85 | out[0..8].copy_from_slice(&self.physical_ms.to_be_bytes()); |
| 86 | out[8..10].copy_from_slice(&self.logical.to_be_bytes()); |
| 87 | out[10..18].copy_from_slice(&self.replica_id.0.to_be_bytes()); |
| 88 | out |
| 89 | } |
| 90 | |
| 91 | /// Decode from a 18-byte big-endian slice produced by [`Hlc::to_bytes`]. |
| 92 | /// |
no outgoing calls