Struct compose_spec::Identifier
source · pub struct Identifier(/* private fields */);Expand description
Validated identifier for use as a map key in a Compose file.
Used to identify top-level items like services, networks, and volumes.
Identifiers must not be empty, start with an ASCII letter (a-z, A-Z) or digit (0-9), and only contain ASCII letters (a-z, A-Z), digits (0-9), dots (.), underscores (_), or dashes (-).
Implementations§
source§impl Identifier
impl Identifier
sourcepub fn new<T>(identifier: T) -> Result<Self, InvalidIdentifierError>
pub fn new<T>(identifier: T) -> Result<Self, InvalidIdentifierError>
Create a new Identifier, validating the given string.
§Errors
Returns an error if the given string is not a valid Identifier. Identifiers must not be
empty, start with an ASCII letter (a-z, A-Z) or digit (0-9), and only contain ASCII letters
(a-z, A-Z), digits (0-9), dots (.), underscores (_), or dashes (-).
Trait Implementations§
source§impl AsRef<str> for Identifier
impl AsRef<str> for Identifier
source§impl Borrow<str> for Identifier
impl Borrow<str> for Identifier
source§impl Clone for Identifier
impl Clone for Identifier
source§fn clone(&self) -> Identifier
fn clone(&self) -> Identifier
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for Identifier
impl Debug for Identifier
source§impl<'_de> Deserialize<'_de> for Identifier
impl<'_de> Deserialize<'_de> for Identifier
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'_de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'_de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Identifier
impl Display for Identifier
source§impl From<Identifier> for Box<str>
impl From<Identifier> for Box<str>
source§fn from(value: Identifier) -> Self
fn from(value: Identifier) -> Self
Converts to this type from the input type.
source§impl From<Identifier> for ConfigOrSecret
impl From<Identifier> for ConfigOrSecret
source§fn from(source: Identifier) -> Self
fn from(source: Identifier) -> Self
Converts to this type from the input type.
source§impl From<Identifier> for Link
impl From<Identifier> for Link
source§fn from(service: Identifier) -> Self
fn from(service: Identifier) -> Self
Converts to this type from the input type.
source§impl<L> From<Identifier> for ShortOrLong<Identifier, L>
impl<L> From<Identifier> for ShortOrLong<Identifier, L>
source§fn from(value: Identifier) -> Self
fn from(value: Identifier) -> Self
Converts to this type from the input type.
source§impl From<Identifier> for Source
impl From<Identifier> for Source
source§fn from(value: Identifier) -> Self
fn from(value: Identifier) -> Self
Converts to this type from the input type.
source§impl From<Identifier> for String
impl From<Identifier> for String
source§fn from(value: Identifier) -> Self
fn from(value: Identifier) -> Self
Converts to this type from the input type.
source§impl FromStr for Identifier
impl FromStr for Identifier
source§impl Hash for Identifier
impl Hash for Identifier
source§impl Ord for Identifier
impl Ord for Identifier
source§fn cmp(&self, other: &Identifier) -> Ordering
fn cmp(&self, other: &Identifier) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<&str> for Identifier
impl PartialEq<&str> for Identifier
source§impl PartialEq<str> for Identifier
impl PartialEq<str> for Identifier
source§impl PartialEq for Identifier
impl PartialEq for Identifier
source§fn eq(&self, other: &Identifier) -> bool
fn eq(&self, other: &Identifier) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for Identifier
impl PartialOrd for Identifier
source§fn partial_cmp(&self, other: &Identifier) -> Option<Ordering>
fn partial_cmp(&self, other: &Identifier) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for Identifier
impl Serialize for Identifier
source§impl TryFrom<&str> for Identifier
impl TryFrom<&str> for Identifier
source§impl TryFrom<String> for Identifier
impl TryFrom<String> for Identifier
impl Eq for Identifier
impl StructuralPartialEq for Identifier
Auto Trait Implementations§
impl Freeze for Identifier
impl RefUnwindSafe for Identifier
impl Send for Identifier
impl Sync for Identifier
impl Unpin for Identifier
impl UnwindSafe for Identifier
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.