pub struct Nsid(/* private fields */);Expand description
A validated NSID (Namespaced Identifier).
Format: authority.name where authority is reversed domain (e.g., com.atproto.repo.createRecord).
Implementations§
Source§impl Nsid
impl Nsid
Sourcepub fn new(s: &str) -> Result<Self, InvalidNsidError>
pub fn new(s: &str) -> Result<Self, InvalidNsidError>
Create a new Nsid from a string, validating the format.
Sourcepub fn create(authority: &str, name: &str) -> Result<Self, InvalidNsidError>
pub fn create(authority: &str, name: &str) -> Result<Self, InvalidNsidError>
Compose an NSID from an authority (reverse-DNS prefix, e.g.
app.bsky.feed) and a name (e.g. post). The inverse of
Nsid::authority + Nsid::name. Validates the result.
Mirrors TS NSID.create(authority, name).
Return the authority portion (all segments except the last).
For com.atproto.repo.createRecord, returns com.atproto.repo.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Return the name portion (last segment).
For com.atproto.repo.createRecord, returns createRecord.
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consume and return the inner string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Nsid
impl<'de> Deserialize<'de> for Nsid
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 Ord for Nsid
impl Ord for Nsid
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
Source§impl PartialOrd for Nsid
impl PartialOrd for Nsid
impl Eq for Nsid
impl StructuralPartialEq for Nsid
Auto Trait Implementations§
impl Freeze for Nsid
impl RefUnwindSafe for Nsid
impl Send for Nsid
impl Sync for Nsid
impl Unpin for Nsid
impl UnsafeUnpin for Nsid
impl UnwindSafe for Nsid
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