radicle_ci_broker::msg

Struct RepoId

Source
pub struct RepoId(/* private fields */);
Expand description

A repository identifier.

Implementations§

Source§

impl RepoId

Source

pub fn urn(&self) -> String

Format the identifier as a human-readable URN.

Eg. rad:z3XncAdkZjeK9mQS5Sdc4qhw98BUX.

Source

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.

Source

pub fn canonical(&self) -> String

Format the identifier as a multibase string.

Eg. z3XncAdkZjeK9mQS5Sdc4qhw98BUX.

Source

pub fn from_canonical(input: &str) -> Result<RepoId, IdError>

Methods from Deref<Target = Oid>§

Source

pub fn as_bytes(&self) -> &[u8]

View this OID as a byte-slice 20 bytes in length.

Source

pub fn is_zero(&self) -> bool

Test if this OID is all zeros.

Trait Implementations§

Source§

impl Arbitrary for RepoId

Source§

fn arbitrary(g: &mut Gen) -> RepoId

Return an arbitrary value. Read more
Source§

fn shrink(&self) -> Box<dyn Iterator<Item = Self>>

Return an iterator of values that are smaller than itself. Read more
Source§

impl BindableWithIndex for &RepoId

Source§

fn bind<I>(self, stmt: &mut Statement<'_>, i: I) -> Result<(), Error>
where I: ParameterIndex,

Bind to a parameter. Read more
Source§

impl Clone for RepoId

Source§

fn clone(&self) -> RepoId

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RepoId

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Deref for RepoId

Source§

type Target = Oid

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<RepoId as Deref>::Target

Dereferences the value.
Source§

impl<'de> Deserialize<'de> for RepoId

Source§

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 Display for RepoId

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<Oid> for RepoId

Source§

fn from(oid: Oid) -> RepoId

Converts to this type from the input type.
Source§

impl From<Oid> for RepoId

Source§

fn from(oid: Oid) -> RepoId

Converts to this type from the input type.
Source§

impl FromStr for RepoId

Source§

type Err = IdError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<RepoId, <RepoId as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for RepoId

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for RepoId

Source§

fn cmp(&self, other: &RepoId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for RepoId

Source§

fn eq(&self, other: &RepoId) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for RepoId

Source§

fn partial_cmp(&self, other: &RepoId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for RepoId

Source§

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
Source§

impl TryFrom<&Value> for RepoId

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<RepoId, <RepoId as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<OsString> for RepoId

Source§

type Error = IdError

The type returned in the event of a conversion error.
Source§

fn try_from( value: OsString, ) -> Result<RepoId, <RepoId as TryFrom<OsString>>::Error>

Performs the conversion.
Source§

impl Copy for RepoId

Source§

impl Eq for RepoId

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,