pub struct SubjectUrn(/* private fields */);Expand description
Tranche-1 seam-freeze G3 subject URN.
Promotes the CloudEvents subject envelope field from a free-form string
(cell:<id> was the legacy convention) to a typed, validated URN of the
form urn:<tool>:<kind>:<id>. See docs/seam-freeze-v1.md §3 G3 / §4.
0ryant-shell and tedit use the URN prefix as a routing key; CellOS
emitters use cell_subject_urn for cell subjects. Other tools mint
their own (urn:tsafe:lease:<id>, urn:tencrypt:cert:<id>, etc.).
Validation rules (see SubjectUrn::parse):
- must start with the literal scheme
urn:; - exactly four colon-separated segments —
urn,<tool>,<kind>,<id>— where<id>may itself contain colons; <tool>,<kind>,<id>must each be non-empty;<tool>and<kind>are restricted to lowercase ASCII alphanumerics and-(charset[a-z0-9-]);- no ASCII control characters and no whitespace anywhere.
<id> is intentionally permissive on charset (so producers can carry
existing IDs like ULIDs, UUIDs, or cell-<host>-<n>) but still must not
contain ASCII control or whitespace.
Implementations§
Source§impl SubjectUrn
impl SubjectUrn
Sourcepub fn parse(s: impl Into<String>) -> Result<Self, SubjectUrnError>
pub fn parse(s: impl Into<String>) -> Result<Self, SubjectUrnError>
Validate s and wrap it as a typed SubjectUrn. See the type-level
documentation for the exact rules.
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consume the wrapper and return the owned string.
Trait Implementations§
Source§impl AsRef<str> for SubjectUrn
impl AsRef<str> for SubjectUrn
Source§impl Clone for SubjectUrn
impl Clone for SubjectUrn
Source§fn clone(&self) -> SubjectUrn
fn clone(&self) -> SubjectUrn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubjectUrn
impl Debug for SubjectUrn
Source§impl Display for SubjectUrn
impl Display for SubjectUrn
Source§impl Hash for SubjectUrn
impl Hash for SubjectUrn
Source§impl PartialEq for SubjectUrn
impl PartialEq for SubjectUrn
Source§fn eq(&self, other: &SubjectUrn) -> bool
fn eq(&self, other: &SubjectUrn) -> bool
self and other values to be equal, and is used by ==.