[][src]Struct conjure_object::ResourceIdentifier

pub struct ResourceIdentifier { /* fields omitted */ }

A common format for wrapping existing unique identifiers to provide additional context.

Resource identifiers contain 4 components, prefixed by a format identifier ri, and separated with periods: ri.<service>.<instance>.<type>.<locator>.

  • Service: The service or application that namespaces the rest of the identifier. Must conform to the regex pattern [a-z][a-z0-9\-]*.
  • Instance: An optionally empty string that represents the specific service cluster, to allow for disambiduation of artifacts from different service clusters. Must conform to the regex pattern ([a-z0-9][a-z0-9\-]*)?.
  • Type: A service-specific resource type to namespace a group of locators. Must conform to the regex pattern [a-z][a-z0-9\-\._]+.
  • Locator: A string used to uniquely locate the specific resource. Must conform to the regex pattern [a-zA-Z0-9\-\._]+.

Methods

impl ResourceIdentifier[src]

pub fn new(s: &str) -> Result<ResourceIdentifier, ParseError>[src]

Creates a resource identifier from a string.

This function behaves identically to ResourceIdentifier's FromStr implementation.

pub fn from_components(
    service: &str,
    instance: &str,
    type_: &str,
    locator: &str
) -> Result<ResourceIdentifier, ParseError>
[src]

Creates a resource identifier from its individual components.

pub fn service(&self) -> &str[src]

Returns the service component of the resource identifier.

pub fn instance(&self) -> &str[src]

Returns the instance component of the resource identifier.

pub fn type_(&self) -> &str[src]

Returns the type component of the resource identifier.

pub fn locator(&self) -> &str[src]

Returns the locator component of the resource identifier.

pub fn as_str(&self) -> &str[src]

Returns the string representation of the resource identifier.

pub fn into_string(self) -> String[src]

Consumes the resource identifier, returning its owned string representation.

Trait Implementations

impl Plain for ResourceIdentifier[src]

impl FromPlain for ResourceIdentifier[src]

type Err = <ResourceIdentifier as FromStr>::Err

The error type returned when parsing fails.

impl PartialEq<ResourceIdentifier> for ResourceIdentifier[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl AsRef<str> for ResourceIdentifier[src]

impl Clone for ResourceIdentifier[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Ord for ResourceIdentifier[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Eq for ResourceIdentifier[src]

impl PartialOrd<ResourceIdentifier> for ResourceIdentifier[src]

impl Debug for ResourceIdentifier[src]

impl Display for ResourceIdentifier[src]

impl FromStr for ResourceIdentifier[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl Hash for ResourceIdentifier[src]

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

Feeds a slice of this type into the given [Hasher]. Read more

impl Borrow<str> for ResourceIdentifier[src]

impl Serialize for ResourceIdentifier[src]

impl<'de> Deserialize<'de> for ResourceIdentifier[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToPlain for T where
    T: Plain + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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