Struct conjure_object::ResourceIdentifier
source · [−]pub struct ResourceIdentifier { /* private fields */ }
Expand description
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\-\._]+
.
Implementations
sourceimpl ResourceIdentifier
impl ResourceIdentifier
sourcepub fn new(s: &str) -> Result<ResourceIdentifier, ParseError>
pub fn new(s: &str) -> Result<ResourceIdentifier, ParseError>
Creates a resource identifier from a string.
This function behaves identically to ResourceIdentifier
’s FromStr
implementation.
sourcepub fn from_components(
service: &str,
instance: &str,
type_: &str,
locator: &str
) -> Result<ResourceIdentifier, ParseError>
pub fn from_components(
service: &str,
instance: &str,
type_: &str,
locator: &str
) -> Result<ResourceIdentifier, ParseError>
Creates a resource identifier from its individual components.
sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the resource identifier, returning its owned string representation.
Trait Implementations
sourceimpl AsRef<str> for ResourceIdentifier
impl AsRef<str> for ResourceIdentifier
sourceimpl Borrow<str> for ResourceIdentifier
impl Borrow<str> for ResourceIdentifier
sourceimpl Clone for ResourceIdentifier
impl Clone for ResourceIdentifier
sourcefn clone(&self) -> ResourceIdentifier
fn clone(&self) -> ResourceIdentifier
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ResourceIdentifier
impl Debug for ResourceIdentifier
sourceimpl<'de> Deserialize<'de> for ResourceIdentifier
impl<'de> Deserialize<'de> for ResourceIdentifier
sourcefn deserialize<D>(d: D) -> Result<ResourceIdentifier, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<ResourceIdentifier, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for ResourceIdentifier
impl Display for ResourceIdentifier
sourceimpl FromPlain for ResourceIdentifier
impl FromPlain for ResourceIdentifier
type Err = <ResourceIdentifier as FromStr>::Err
type Err = <ResourceIdentifier as FromStr>::Err
The error type returned when parsing fails.
sourcefn from_plain(s: &str) -> Result<Self, Self::Err>
fn from_plain(s: &str) -> Result<Self, Self::Err>
Parse a value from its Conjure PLAIN string representation.
sourceimpl FromStr for ResourceIdentifier
impl FromStr for ResourceIdentifier
type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
sourcefn from_str(s: &str) -> Result<ResourceIdentifier, ParseError>
fn from_str(s: &str) -> Result<ResourceIdentifier, ParseError>
Parses a string
s
to return a value of this type. Read moresourceimpl Hash for ResourceIdentifier
impl Hash for ResourceIdentifier
sourceimpl Ord for ResourceIdentifier
impl Ord for ResourceIdentifier
sourcefn cmp(&self, other: &ResourceIdentifier) -> Ordering
fn cmp(&self, other: &ResourceIdentifier) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<ResourceIdentifier> for ResourceIdentifier
impl PartialEq<ResourceIdentifier> for ResourceIdentifier
sourcefn eq(&self, other: &ResourceIdentifier) -> bool
fn eq(&self, other: &ResourceIdentifier) -> bool
sourceimpl PartialOrd<ResourceIdentifier> for ResourceIdentifier
impl PartialOrd<ResourceIdentifier> for ResourceIdentifier
sourcefn partial_cmp(&self, other: &ResourceIdentifier) -> Option<Ordering>
fn partial_cmp(&self, other: &ResourceIdentifier) -> Option<Ordering>
sourcefn gt(&self, other: &ResourceIdentifier) -> bool
fn gt(&self, other: &ResourceIdentifier) -> bool
sourcefn ge(&self, other: &ResourceIdentifier) -> bool
fn ge(&self, other: &ResourceIdentifier) -> bool
This method tests greater than or equal to (for
self
and other
) and is used by the >=
operator. Read moresourcefn lt(&self, other: &ResourceIdentifier) -> bool
fn lt(&self, other: &ResourceIdentifier) -> bool
sourcefn le(&self, other: &ResourceIdentifier) -> bool
fn le(&self, other: &ResourceIdentifier) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl Plain for ResourceIdentifier
impl Plain for ResourceIdentifier
sourceimpl Serialize for ResourceIdentifier
impl Serialize for ResourceIdentifier
impl Eq for ResourceIdentifier
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more