pub struct ScopeLabel(/* private fields */);Expand description
Immutable 1..=64-byte scope label. Shape grants no authority. Colon-separated segments start with a lowercase ASCII letter or digit; subsequent bytes may also be underscore or hyphen. No normalization occurs.
ⓘ
use ic_auth_protocol_types::ScopeLabel;
fn change(scope: &mut ScopeLabel) { scope.as_str().clear(); }Implementations§
Source§impl ScopeLabel
impl ScopeLabel
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Borrow the validated label without allocating or changing its spelling.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Recover the owned validated text without copying its allocation.
Sourcepub fn from_strings(values: Vec<String>) -> Result<Vec<Self>, ScopeLabelError>
pub fn from_strings(values: Vec<String>) -> Result<Vec<Self>, ScopeLabelError>
Admit an owned sequence without sorting or imposing cardinality policy. Callers admit their count bound first; the first grammar failure wins.
Trait Implementations§
Source§impl AsRef<str> for ScopeLabel
impl AsRef<str> for ScopeLabel
Source§impl Clone for ScopeLabel
impl Clone for ScopeLabel
Source§impl Debug for ScopeLabel
impl Debug for ScopeLabel
Source§impl<'de> Deserialize<'de> for ScopeLabel
impl<'de> Deserialize<'de> for ScopeLabel
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ScopeLabel
impl Display for ScopeLabel
impl Eq for ScopeLabel
Source§impl FromStr for ScopeLabel
impl FromStr for ScopeLabel
Source§impl Hash for ScopeLabel
impl Hash for ScopeLabel
Source§impl Ord for ScopeLabel
impl Ord for ScopeLabel
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ScopeLabel
impl PartialEq for ScopeLabel
Source§impl PartialOrd for ScopeLabel
impl PartialOrd for ScopeLabel
Source§impl Serialize for ScopeLabel
impl Serialize for ScopeLabel
impl StructuralPartialEq for ScopeLabel
Auto Trait Implementations§
impl Forget for ScopeLabel
impl Freeze for ScopeLabel
impl Move for ScopeLabel
impl RefUnwindSafe for ScopeLabel
impl Send for ScopeLabel
impl Sync for ScopeLabel
impl Unpin for ScopeLabel
impl UnsafeUnpin for ScopeLabel
impl UnwindSafe for ScopeLabel
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
Mutably borrows from an owned value. Read more