pub struct DependencyName { /* private fields */ }Expand description
A dependency name.
Dependency names begin with an ASCII letter and continue with ASCII
letters, digits, underscores, or hyphens. Following Cargo’s
convention, hyphens and underscores are interchangeable: spell-book
and spell_book refer to the same dependency.
Two forms are stored: the manifest form preserves the exact
spelling from module.json, and the identifier form replaces
hyphens with underscores to produce a valid WDL identifier suitable
for use in symbolic imports. The identifier form must not be a
reserved keyword.
Eq, Ord, and Hash operate on the identifier form only,
so spell-book and spell_book are the same key in maps and
sets. This enforces the spec rule that hyphens and underscores are
interchangeable for the purpose of identity. Use
manifest() when exact-spelling fidelity is
needed (e.g., serialization or display).
Implementations§
Source§impl DependencyName
impl DependencyName
Sourcepub fn identifier(&self) -> &str
pub fn identifier(&self) -> &str
Returns the WDL identifier form of the name (hyphens replaced with underscores).
Sourcepub fn into_manifest(self) -> String
pub fn into_manifest(self) -> String
Consumes the DependencyName and returns the manifest form.
Sourcepub fn into_identifier(self) -> String
pub fn into_identifier(self) -> String
Consumes the DependencyName and returns the identifier form.
Trait Implementations§
Source§impl AsRef<str> for DependencyName
impl AsRef<str> for DependencyName
Source§impl Clone for DependencyName
impl Clone for DependencyName
Source§fn clone(&self) -> DependencyName
fn clone(&self) -> DependencyName
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DependencyName
impl Debug for DependencyName
Source§impl<'de> Deserialize<'de> for DependencyName
impl<'de> Deserialize<'de> for DependencyName
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>,
impl Eq for DependencyName
Source§impl From<DependencyName> for String
impl From<DependencyName> for String
Source§fn from(name: DependencyName) -> Self
fn from(name: DependencyName) -> Self
Source§impl FromStr for DependencyName
impl FromStr for DependencyName
Source§impl Hash for DependencyName
impl Hash for DependencyName
Source§impl Ord for DependencyName
impl Ord for DependencyName
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for DependencyName
impl PartialEq for DependencyName
Source§impl PartialOrd for DependencyName
impl PartialOrd for DependencyName
Source§impl Serialize for DependencyName
impl Serialize for DependencyName
Auto Trait Implementations§
impl Freeze for DependencyName
impl RefUnwindSafe for DependencyName
impl Send for DependencyName
impl Sync for DependencyName
impl Unpin for DependencyName
impl UnsafeUnpin for DependencyName
impl UnwindSafe for DependencyName
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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§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
key and return true if they are equal.