pub struct ScopeLabel(/* private fields */);Expand description
ScopeLabel
An immutable, unnormalized 1–64-byte scope label.
Colon-separated segments start with [a-z0-9] and continue with
[a-z0-9_-]. A valid label says nothing about which caller may use it.
ⓘ
use ic_auth_protocol_types::ScopeLabel;
let unchecked = ScopeLabel(String::from("Invalid"));Implementations§
Source§impl ScopeLabel
impl ScopeLabel
Sourcepub fn validate(text: &str) -> Result<(), ScopeLabelError>
pub fn validate(text: &str) -> Result<(), ScopeLabelError>
Check grammar without allocating or normalizing input.
Length errors precede grammar errors; grammar reports the first invalid segment or byte in input order.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Recover the original owned text without copying.
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 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
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