pub struct SafeLabel { /* private fields */ }Expand description
A string that is safe to publish on a manifest surface.
Construct with SafeLabel::identifier, SafeLabel::catalog_model, or
SafeLabel::phrase; all fall back to a fingerprint when the input is not
on the allowlist. There is deliberately no constructor that takes
arbitrary text verbatim.
Implementations§
Source§impl SafeLabel
impl SafeLabel
Sourcepub fn identifier(raw: &str) -> Self
pub fn identifier(raw: &str) -> Self
A generic identifier-shaped value: provider id, route id, reasoning
tier. Allows A-Z a-z 0-9 . _ : - + @ and rejects every slash. Model
ids with a slash must use Self::catalog_model instead.
Sourcepub fn catalog_model(raw: &str) -> Self
pub fn catalog_model(raw: &str) -> Self
A model label. Slash-bearing values are published only when the exact id exists in the active local model catalog; a vendor-looking prefix is never authority by itself. Non-slash ids retain the generic identifier boundary for custom compatible deployments.
Sourcepub fn phrase(raw: &str) -> Self
pub fn phrase(raw: &str) -> Self
A short human phrase: the same allowlist plus spaces, parentheses, and commas, for host-supplied presentation labels.
pub fn as_str(&self) -> &str
Trait Implementations§
impl Eq for SafeLabel
impl StructuralPartialEq for SafeLabel
Auto Trait Implementations§
impl Freeze for SafeLabel
impl RefUnwindSafe for SafeLabel
impl Send for SafeLabel
impl Sync for SafeLabel
impl Unpin for SafeLabel
impl UnsafeUnpin for SafeLabel
impl UnwindSafe for SafeLabel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.