pub struct DecisionId(/* private fields */);Expand description
128-bit identifier linking a runtime decision to its EvidenceLedger entry.
Structurally identical to TraceId but semantically distinct.
Implementations§
Source§impl DecisionId
impl DecisionId
Sourcepub const fn from_parts(ts_ms: u64, random: u128) -> Self
pub const fn from_parts(ts_ms: u64, random: u128) -> Self
Create from millisecond timestamp and random bits.
ts_ms is saturated to the 48-bit field (matching
TraceId::from_parts) so an out-of-range value — e.g. microseconds
or nanoseconds passed by a unit-error — never silently corrupts the
“high 48 = ts, low 80 = random” layout. Without saturation,
(ts_ms as u128) << 80 shifts the top bits of an out-of-range ts_ms
off the 128-bit word, so timestamp_ms would return a truncated value.
Use Self::try_from_parts for a strict, error-returning surface.
(br-asupersync-rxe2sg)
Sourcepub const fn try_from_parts(ts_ms: u64, random: u128) -> Result<Self, u64>
pub const fn try_from_parts(ts_ms: u64, random: u128) -> Result<Self, u64>
Strict variant of Self::from_parts (br-asupersync-rxe2sg).
Returns Err(ts_ms) when the millisecond timestamp does not fit in the
48-bit field, mirroring TraceId::try_from_parts.
§Errors
Returns Err(ts_ms) if ts_ms >= 2^48.
Sourcepub const fn timestamp_ms(self) -> u64
pub const fn timestamp_ms(self) -> u64
Extract the millisecond timestamp.
Sourcepub const fn from_bytes(bytes: [u8; 16]) -> Self
pub const fn from_bytes(bytes: [u8; 16]) -> Self
Construct from big-endian bytes.
Trait Implementations§
Source§impl Clone for DecisionId
impl Clone for DecisionId
Source§fn clone(&self) -> DecisionId
fn clone(&self) -> DecisionId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more