pub enum AtprotoStr<'s> {
Datetime(Datetime),
Language(Language),
Tid(Tid),
Nsid(Nsid<'s>),
Did(Did<'s>),
Handle(Handle<'s>),
AtIdentifier(AtIdentifier<'s>),
AtUri(AtUri<'s>),
Uri(Uri<'s>),
Cid(Cid<'s>),
RecordKey(RecordKey<Rkey<'s>>),
String(CowStr<'s>),
}Expand description
Polymorphic AT Protocol string value
Represents any AT Protocol string type, automatically detecting and parsing into the appropriate variant. Used internally for generic value handling.
Variants are checked in order from most specific to least specific. Note that record keys are intentionally NOT parsed from bare strings as the validation is too permissive and would catch too many values.
Variants§
Datetime(Datetime)
ISO 8601 datetime
Language(Language)
BCP 47 language tag
Tid(Tid)
Timestamp identifier
Nsid(Nsid<'s>)
Namespaced identifier
Did(Did<'s>)
Decentralized identifier
Handle(Handle<'s>)
Account handle
AtIdentifier(AtIdentifier<'s>)
Identifier (DID or handle)
AtUri(AtUri<'s>)
AT URI
Uri(Uri<'s>)
Generic URI
Cid(Cid<'s>)
Content identifier
RecordKey(RecordKey<Rkey<'s>>)
Record key
String(CowStr<'s>)
Plain string (fallback)
Implementations§
Source§impl<'s> AtprotoStr<'s>
impl<'s> AtprotoStr<'s>
Sourcepub fn new(string: &'s str) -> Self
pub fn new(string: &'s str) -> Self
Borrowing constructor for bare atproto string values This is fairly exhaustive and potentially slow, prefer using anything that narrows down the search field quicker.
Note: We don’t construct record keys from bare strings in this because the type is too permissive and too many things would be classified as rkeys.
Value object deserialization checks against the field names for common names (uri, cid, did, handle, createdAt, indexedAt, etc.) to improve performance of the happy path.
Source§impl AtprotoStr<'static>
impl AtprotoStr<'static>
Sourcepub fn new_owned(string: impl AsRef<str>) -> AtprotoStr<'static>
pub fn new_owned(string: impl AsRef<str>) -> AtprotoStr<'static>
Owned constructor for bare atproto string values This is fairly exhaustive and potentially slow, prefer using anything that narrows down the search field quicker.
Note: We don’t construct record keys from bare strings in this because the type is too permissive and too many things would be classified as rkeys.
Value object deserialization checks against the field names for common names (uri, cid, did, handle, createdAt, indexedAt, etc.) to improve performance of the happy path.
Trait Implementations§
Source§impl<'s> AsRef<str> for AtprotoStr<'s>
impl<'s> AsRef<str> for AtprotoStr<'s>
Source§impl<'s> Clone for AtprotoStr<'s>
impl<'s> Clone for AtprotoStr<'s>
Source§fn clone(&self) -> AtprotoStr<'s>
fn clone(&self) -> AtprotoStr<'s>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'s> Debug for AtprotoStr<'s>
impl<'s> Debug for AtprotoStr<'s>
Source§impl<'de, 'a> Deserialize<'de> for AtprotoStr<'a>where
'de: 'a,
impl<'de, 'a> Deserialize<'de> for AtprotoStr<'a>where
'de: 'a,
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>,
Source§impl From<AtprotoStr<'_>> for String
impl From<AtprotoStr<'_>> for String
Source§fn from(value: AtprotoStr<'_>) -> Self
fn from(value: AtprotoStr<'_>) -> Self
Source§impl<'s> Hash for AtprotoStr<'s>
impl<'s> Hash for AtprotoStr<'s>
Source§impl IntoStatic for AtprotoStr<'_>
impl IntoStatic for AtprotoStr<'_>
Source§type Output = AtprotoStr<'static>
type Output = AtprotoStr<'static>
Cow<'a, str>, this is Cow<'static, str>, for example.Source§fn into_static(self) -> Self::Output
fn into_static(self) -> Self::Output
Source§impl<'s> PartialEq for AtprotoStr<'s>
impl<'s> PartialEq for AtprotoStr<'s>
Source§impl Serialize for AtprotoStr<'_>
impl Serialize for AtprotoStr<'_>
impl<'s> Eq for AtprotoStr<'s>
impl<'s> StructuralPartialEq for AtprotoStr<'s>
Auto Trait Implementations§
impl<'s> Freeze for AtprotoStr<'s>
impl<'s> RefUnwindSafe for AtprotoStr<'s>
impl<'s> Send for AtprotoStr<'s>
impl<'s> Sync for AtprotoStr<'s>
impl<'s> Unpin for AtprotoStr<'s>
impl<'s> UnwindSafe for AtprotoStr<'s>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.