pub struct Reference {
pub repository: Repository,
pub tag: Option<String>,
pub digest: Option<String>,
}Expand description
A reference is a named reference to an image
Examples:
docker.io/library/alpinedocker.io/library/alpine:latestdocker.io/library/alpine@sha256:86e0e091d0da6bde2456dbb48306f3956bbeb2eae1b5b9a43045843f69fe4aaa
Fields§
§repository: RepositoryThe repository of the reference, (e.g. docker.io/library/alpine)
tag: Option<String>The tag of the reference, (e.g. latest)
digest: Option<String>The digest of the reference, (e.g. sha256:86e0e091d0da6bde2456dbb48306f3956bbeb2eae1b5b9a43045843f69fe4aaa)
Implementations§
Source§impl Reference
impl Reference
Sourcepub fn parse(s: impl AsRef<str>) -> Result<Reference, Error>
pub fn parse(s: impl AsRef<str>) -> Result<Reference, Error>
Parse parses s and returns a syntactically valid Reference
Sourcepub fn parse_normalized_named(s: &str) -> Result<Reference, Error>
pub fn parse_normalized_named(s: &str) -> Result<Reference, Error>
Parses a string into a named reference transforming a familiar name from Docker UI to a fully qualified reference
Sourcepub fn domain(&self) -> &str
pub fn domain(&self) -> &str
Returns the domain of the reference, or the default domain (docker.io) if it is not set
Sourcepub fn path(&self) -> Option<Cow<'_, str>>
pub fn path(&self) -> Option<Cow<'_, str>>
Returns the path of the reference, normalized if it is an official repository
Sourcepub fn rank_ord(&self, other: &Reference) -> Ordering
pub fn rank_ord(&self, other: &Reference) -> Ordering
rank_ord returns a Ordering based on the following rules preferring higher
information references, then by the lexicographical ordering of the reference string:
| Rule | Example |
|---|---|
| [Named] + [Tagged] + [Digested] | docker.io/library/busybox:latest@sha256:<digest> |
| [Named] + [Tagged] | docker.io/library/busybox:latest |
| [Named] + [Digested] | docker.io/library/busybo@sha256:<digest> |
| [Named] | docker.io/library/busybox |
| [Digested] | docker.io@sha256:<digest> |
| Error | The reference is not valid due to not matching any of the above rules |
Trait Implementations§
impl Eq for Reference
impl StructuralPartialEq for Reference
Auto Trait Implementations§
impl Freeze for Reference
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnwindSafe for Reference
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> 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.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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request