pub struct RegistryId { /* private fields */ }Expand description
A registry-qualified identifier, <registry>:<name>, checked where it is read.
The qualification is load-bearing rather than decorative: one repository here
publishes onevcs-cli to PyPI and to npm, on two cadences, so an unqualified
onevcs-cli names two artifacts and a consumer waiting on it cannot say which
one it got.
The registry half is an open vocabulary. crate, pypi and npm are what this
repository’s own probe answers for, but a declaration is written by six
repositories and a closed set here would refuse an artifact somebody genuinely
publishes — a container image, a registry nobody has needed yet — at the one
boundary that has no way to grant an exception. What is closed is the shape:
exactly one colon, both halves present, and a name spelled in the alphabet every
registry serves.
The name half is exactly what that registry serves, which for npm includes a
scoped package: npm:@oneharness/cli-linux-x64 is a name npm publishes, and a
grammar that refused it would force a producer to choose between declaring an
artifact npm does not serve and hiding one it does. So a name is either a plain
one — a letter or a digit, then the alphabet crates.io, PyPI and npm all serve —
or the scoped form @scope/name, whose two halves are each a plain one. That is
the whole of the leading @: it takes a scope and exactly one /, so @, @/x,
@scope/ and @scope/a/b are all still refused.
Implementations§
Trait Implementations§
Source§impl Clone for RegistryId
impl Clone for RegistryId
Source§impl Debug for RegistryId
The identifier itself, quoted — never the wrapper, for the reason
TargetName spells its own: every refusal that names one writes it with
{:?}, and a derived Debug would spell a struct at an operator who wrote
crate:onevcs.
impl Debug for RegistryId
The identifier itself, quoted — never the wrapper, for the reason
TargetName spells its own: every refusal that names one writes it with
{:?}, and a derived Debug would spell a struct at an operator who wrote
crate:onevcs.
Source§impl<'de> Deserialize<'de> for RegistryId
impl<'de> Deserialize<'de> for RegistryId
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>,
Source§impl Display for RegistryId
impl Display for RegistryId
impl Eq for RegistryId
Source§impl From<RegistryId> for String
impl From<RegistryId> for String
Source§fn from(id: RegistryId) -> Self
fn from(id: RegistryId) -> Self
Source§impl FromStr for RegistryId
The conversion an argument parser and a consumer both reach for, which is the
same check the document gets.
impl FromStr for RegistryId
The conversion an argument parser and a consumer both reach for, which is the same check the document gets.
Source§impl Hash for RegistryId
impl Hash for RegistryId
Source§impl Ord for RegistryId
impl Ord for RegistryId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RegistryId
impl PartialEq for RegistryId
Source§impl PartialOrd for RegistryId
impl PartialOrd for RegistryId
Source§impl Serialize for RegistryId
impl Serialize for RegistryId
impl StructuralPartialEq for RegistryId
Auto Trait Implementations§
impl Freeze for RegistryId
impl RefUnwindSafe for RegistryId
impl Send for RegistryId
impl Sync for RegistryId
impl Unpin for RegistryId
impl UnsafeUnpin for RegistryId
impl UnwindSafe for RegistryId
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.