pub struct TypedPrefixedId<K> { /* private fields */ }Implementations§
Source§impl<K> TypedPrefixedId<K>
impl<K> TypedPrefixedId<K>
pub const fn as_prefixed_id(&self) -> &PrefixedId
pub fn value(&self) -> &str
Source§impl<K> TypedPrefixedId<K>where
K: PrefixedIdentifierKind,
impl<K> TypedPrefixedId<K>where
K: PrefixedIdentifierKind,
Sourcepub fn new(value: &str) -> Result<TypedPrefixedId<K>, IdPrefixError>
pub fn new(value: &str) -> Result<TypedPrefixedId<K>, IdPrefixError>
Creates a typed prefixed identifier using the type-level prefix.
§Errors
Returns the underlying IdPrefixError when the type-level prefix or value is invalid.
Sourcepub fn parse(input: &str) -> Result<TypedPrefixedId<K>, IdPrefixError>
pub fn parse(input: &str) -> Result<TypedPrefixedId<K>, IdPrefixError>
Parses a typed prefixed identifier and verifies that the parsed prefix matches the type.
§Errors
Returns the underlying parsing error or IdPrefixError::MismatchedPrefix when the
parsed prefix does not match the type-level prefix.
pub const fn prefix(&self) -> &'static str
Trait Implementations§
Source§impl<K> Clone for TypedPrefixedId<K>where
K: Clone,
impl<K> Clone for TypedPrefixedId<K>where
K: Clone,
Source§fn clone(&self) -> TypedPrefixedId<K>
fn clone(&self) -> TypedPrefixedId<K>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K> Debug for TypedPrefixedId<K>where
K: Debug,
impl<K> Debug for TypedPrefixedId<K>where
K: Debug,
Source§impl<K> Display for TypedPrefixedId<K>
impl<K> Display for TypedPrefixedId<K>
Source§impl<K> Hash for TypedPrefixedId<K>where
K: Hash,
impl<K> Hash for TypedPrefixedId<K>where
K: Hash,
Source§impl<K> PartialEq for TypedPrefixedId<K>where
K: PartialEq,
impl<K> PartialEq for TypedPrefixedId<K>where
K: PartialEq,
Source§fn eq(&self, other: &TypedPrefixedId<K>) -> bool
fn eq(&self, other: &TypedPrefixedId<K>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<K> Eq for TypedPrefixedId<K>where
K: Eq,
impl<K> StructuralPartialEq for TypedPrefixedId<K>
Auto Trait Implementations§
impl<K> Freeze for TypedPrefixedId<K>
impl<K> RefUnwindSafe for TypedPrefixedId<K>
impl<K> Send for TypedPrefixedId<K>
impl<K> Sync for TypedPrefixedId<K>
impl<K> Unpin for TypedPrefixedId<K>
impl<K> UnsafeUnpin for TypedPrefixedId<K>
impl<K> UnwindSafe for TypedPrefixedId<K>
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