pub struct RepoId(/* private fields */);
Expand description
A repository identifier.
Implementations§
Source§impl RepoId
impl RepoId
Sourcepub fn urn(&self) -> String
pub fn urn(&self) -> String
Format the identifier as a human-readable URN.
Eg. rad:z3XncAdkZjeK9mQS5Sdc4qhw98BUX
.
Sourcepub fn from_urn(s: &str) -> Result<RepoId, IdError>
pub fn from_urn(s: &str) -> Result<RepoId, IdError>
Parse an identifier from the human-readable URN format. Accepts strings without the radicle prefix as well, for convenience.
Sourcepub fn canonical(&self) -> String
pub fn canonical(&self) -> String
Format the identifier as a multibase string.
Eg. z3XncAdkZjeK9mQS5Sdc4qhw98BUX
.
pub fn from_canonical(input: &str) -> Result<RepoId, IdError>
Trait Implementations§
Source§impl BindableWithIndex for &RepoId
impl BindableWithIndex for &RepoId
Source§impl<'de> Deserialize<'de> for RepoId
impl<'de> Deserialize<'de> for RepoId
Source§fn deserialize<D>(
deserializer: D,
) -> Result<RepoId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<RepoId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for RepoId
impl Ord for RepoId
Source§impl PartialOrd for RepoId
impl PartialOrd for RepoId
Source§impl Serialize for RepoId
impl Serialize for RepoId
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for RepoId
impl Eq for RepoId
impl StructuralPartialEq for RepoId
Auto Trait Implementations§
impl Freeze for RepoId
impl RefUnwindSafe for RepoId
impl Send for RepoId
impl Sync for RepoId
impl Unpin for RepoId
impl UnwindSafe for RepoId
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.