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 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 more
sourceimpl 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 more
sourceimpl Hash for ResourceIdentifier
impl Hash for ResourceIdentifier
sourceimpl Ord for ResourceIdentifier
impl Ord for ResourceIdentifier
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>
This method returns an ordering between self
and other
values if one exists. Read more
sourcefn gt(&self, other: &ResourceIdentifier) -> bool
fn gt(&self, other: &ResourceIdentifier) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
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 more
sourcefn lt(&self, other: &ResourceIdentifier) -> bool
fn lt(&self, other: &ResourceIdentifier) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
sourceimpl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more