[−][src]Struct conjure_object::resource_identifier::ResourceIdentifier
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]
service: &str,
instance: &str,
type_: &str,
locator: &str
) -> Result<ResourceIdentifier, ParseError>
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 AsRef<str> for ResourceIdentifier
[src]
impl Borrow<str> for ResourceIdentifier
[src]
impl Clone for ResourceIdentifier
[src]
fn clone(&self) -> ResourceIdentifier
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ResourceIdentifier
[src]
impl<'de> Deserialize<'de> for ResourceIdentifier
[src]
fn deserialize<D>(d: D) -> Result<ResourceIdentifier, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Display for ResourceIdentifier
[src]
impl Eq for ResourceIdentifier
[src]
impl FromPlain for ResourceIdentifier
[src]
type Err = <ResourceIdentifier as FromStr>::Err
The error type returned when parsing fails.
fn from_plain(s: &str) -> Result<Self, Self::Err>
[src]
impl FromStr for ResourceIdentifier
[src]
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<ResourceIdentifier, ParseError>
[src]
impl Hash for ResourceIdentifier
[src]
fn hash<H>(&self, hasher: &mut H) where
H: Hasher,
[src]
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for ResourceIdentifier
[src]
fn cmp(&self, other: &ResourceIdentifier) -> Ordering
[src]
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<ResourceIdentifier> for ResourceIdentifier
[src]
fn eq(&self, other: &ResourceIdentifier) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<ResourceIdentifier> for ResourceIdentifier
[src]
fn partial_cmp(&self, other: &ResourceIdentifier) -> Option<Ordering>
[src]
fn gt(&self, other: &ResourceIdentifier) -> bool
[src]
fn ge(&self, other: &ResourceIdentifier) -> bool
[src]
fn lt(&self, other: &ResourceIdentifier) -> bool
[src]
fn le(&self, other: &ResourceIdentifier) -> bool
[src]
impl Plain for ResourceIdentifier
[src]
impl Serialize for ResourceIdentifier
[src]
Auto Trait Implementations
impl RefUnwindSafe for ResourceIdentifier
impl Send for ResourceIdentifier
impl Sync for ResourceIdentifier
impl Unpin for ResourceIdentifier
impl UnwindSafe for ResourceIdentifier
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToPlain for T where
T: Plain + ?Sized,
[src]
T: Plain + ?Sized,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,