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 Forget for SafeLabel
impl Freeze for SafeLabel
impl Move 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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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.