pub enum AtIdentifier<S: Bos<str> + AsRef<str> = DefaultStr> {
Did(Did<S>),
Handle(Handle<S>),
}Expand description
AT Protocol identifier (either a DID or handle).
Represents the union of DIDs and handles, which can both be used to identify accounts in AT Protocol. DIDs are permanent identifiers, while handles are human-friendly and can change.
Automatically determines whether a string is a DID or a handle during parsing.
Variants§
Implementations§
Source§impl<S: Bos<str> + AsRef<str>> AtIdentifier<S>
impl<S: Bos<str> + AsRef<str>> AtIdentifier<S>
Sourcepub fn new(ident: S) -> Result<Self, AtStrError>
pub fn new(ident: S) -> Result<Self, AtStrError>
Fallible constructor, validates, wraps the input directly.
Tries DID first, then handle. Rejects uppercase handles — use
new_owned() for case-insensitive construction.
Source§impl<S: Bos<str> + AsRef<str> + FromStr> AtIdentifier<S>
impl<S: Bos<str> + AsRef<str> + FromStr> AtIdentifier<S>
Sourcepub fn new_owned(ident: impl AsRef<str>) -> Result<Self, AtStrError>
pub fn new_owned(ident: impl AsRef<str>) -> Result<Self, AtStrError>
Fallible constructor, validates, takes ownership. Strips prefixes and normalises handle case.
Sourcepub fn new_static(ident: &'static str) -> Result<Self, AtStrError>
pub fn new_static(ident: &'static str) -> Result<Self, AtStrError>
Fallible constructor for static strings.
Trait Implementations§
Source§impl<S: Clone + Bos<str> + AsRef<str>> Clone for AtIdentifier<S>
impl<S: Clone + Bos<str> + AsRef<str>> Clone for AtIdentifier<S>
Source§fn clone(&self) -> AtIdentifier<S>
fn clone(&self) -> AtIdentifier<S>
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<'de, S> Deserialize<'de> for AtIdentifier<S>
impl<'de, S> Deserialize<'de> for AtIdentifier<S>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<S: Eq + Bos<str> + AsRef<str>> Eq for AtIdentifier<S>
Source§impl<S: Bos<str> + AsRef<str>> From<AtIdentifier<S>> for String
impl<S: Bos<str> + AsRef<str>> From<AtIdentifier<S>> for String
Source§fn from(value: AtIdentifier<S>) -> Self
fn from(value: AtIdentifier<S>) -> Self
Converts to this type from the input type.
Source§impl From<String> for AtIdentifier
impl From<String> for AtIdentifier
Source§impl FromStr for AtIdentifier
impl FromStr for AtIdentifier
Source§impl FromStr for AtIdentifier<CowStr<'static>>
impl FromStr for AtIdentifier<CowStr<'static>>
Source§impl FromStr for AtIdentifier<String>
impl FromStr for AtIdentifier<String>
Source§impl<S: Bos<str> + AsRef<str> + IntoStatic> IntoStatic for AtIdentifier<S>
impl<S: Bos<str> + AsRef<str> + IntoStatic> IntoStatic for AtIdentifier<S>
Source§type Output = AtIdentifier<<S as IntoStatic>::Output>
type Output = AtIdentifier<<S as IntoStatic>::Output>
The “owned” variant of the type. For
Cow<'a, str>, this is Cow<'static, str>, for example.Source§fn into_static(self) -> Self::Output
fn into_static(self) -> Self::Output
Turns the value into an “owned” variant, which can then be returned, moved, etc. Read more
Source§impl<S: PartialEq + Bos<str> + AsRef<str>> PartialEq for AtIdentifier<S>
impl<S: PartialEq + Bos<str> + AsRef<str>> PartialEq for AtIdentifier<S>
Source§fn eq(&self, other: &AtIdentifier<S>) -> bool
fn eq(&self, other: &AtIdentifier<S>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<S> Serialize for AtIdentifier<S>
impl<S> Serialize for AtIdentifier<S>
impl<S: Bos<str> + AsRef<str>> StructuralPartialEq for AtIdentifier<S>
Auto Trait Implementations§
impl<S> Freeze for AtIdentifier<S>where
S: Freeze,
impl<S> RefUnwindSafe for AtIdentifier<S>where
S: RefUnwindSafe,
impl<S> Send for AtIdentifier<S>where
S: Send,
impl<S> Sync for AtIdentifier<S>where
S: Sync,
impl<S> Unpin for AtIdentifier<S>where
S: Unpin,
impl<S> UnsafeUnpin for AtIdentifier<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for AtIdentifier<S>where
S: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.