pub struct RolloutId(pub(crate) String);Expand description
Content-addressed rollout identifier (RFC-0008 §6.3).
Identity contract: a RolloutId is the canonical
"{channel}@{channel_ref}" composite. Constructed only via
RolloutId::new; the private inner field prevents ad-hoc
construction the same way Verified<T> prevents ad-hoc construction
of a “verified” payload (RFC-0006 §3). Test code that needs to forge
a pre-formed identifier goes through from_raw_for_tests under the
test-helpers feature gate.
Rationale (RFC-0008 §6.3): two channels can share a channel_ref
(the architectural point of multi-channel cascading from a single
git push). channel_ref alone collides in that topology;
channel alone violates the content-addressed property of the rest
of the cycle. The composite preserves both: unique per
(channel, channel_ref) AND deterministic across replays.
SQL bindings: call .as_str() on the field at the params![...]
site. Production code MUST NOT round-trip raw strings into
from_raw_for_tests — the type-level enforcement is the contract.
Tuple Fields§
§0: StringImplementations§
Source§impl RolloutId
impl RolloutId
Sourcepub fn new(channel: &str, channel_ref: &str) -> RolloutId
pub fn new(channel: &str, channel_ref: &str) -> RolloutId
Construct the canonical "{channel}@{channel_ref}" identifier.
The only non-test path to a RolloutId.
channel MUST NOT contain @; the parser splits on the FIRST
@ boundary (per channel() / channel_ref()), so an @ in
channel would break round-trip identity. The wire-level route
validator (CP looks_like_rollout_id) locks channel to
[a-z0-9_-]+ already; the debug_assert! pins the same
invariant at the type boundary so a wire-bypass round-trip
fails fast in development.
Sourcepub fn channel(&self) -> &str
pub fn channel(&self) -> &str
Channel half of the canonical composite (per RFC-0008 §6.3).
Splits on the first @; the constructor’s invariant guarantees
the channel never carries @ itself, so this returns the
operator-declared channel name unmodified.
Sourcepub fn channel_ref(&self) -> &str
pub fn channel_ref(&self) -> &str
Channel-ref half of the canonical composite (per RFC-0008 §6.3).
Splits on the first @; if no @ is present (only reachable via
from_raw_for_tests with a malformed input), returns the empty
string rather than panic.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RolloutId
impl<'de> Deserialize<'de> for RolloutId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RolloutId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RolloutId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl FromSql for RolloutId
Available on crate feature rusqlite only.
impl FromSql for RolloutId
rusqlite only.