[−][src]Struct oci_distribution::Reference
An OCI image reference
Parsing references in the following formats is supported:
<registry>/<repository>
<registry>/<repository>:<tag>
<registry>/<repository>@<digest>
<registry>/<repository>:<tag>@<digest>
Examples
Parsing a tagged image reference:
use oci_distribution::Reference; let reference: Reference = "docker.io/library/hello-world:latest".parse().unwrap(); assert_eq!("docker.io", reference.registry()); assert_eq!("library/hello-world", reference.repository()); assert_eq!(Some("latest"), reference.tag()); assert_eq!(None, reference.digest());
Implementations
impl Reference
[src]
pub fn whole(&self) -> &str
[src]
Get the original reference.
pub fn registry(&self) -> &str
[src]
Get the registry name.
pub fn repository(&self) -> &str
[src]
Get the repository (a.k.a the image name) of this reference
pub fn tag(&self) -> Option<&str>
[src]
Get the tag for this reference.
pub fn digest(&self) -> Option<&str>
[src]
Get the digest for this reference.
Trait Implementations
impl Clone for Reference
[src]
impl Debug for Reference
[src]
impl Display for Reference
[src]
impl Eq for Reference
[src]
impl FromStr for Reference
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for Reference
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<String> for Reference
[src]
impl PartialEq<Reference> for Reference
[src]
impl StructuralEq for Reference
[src]
impl StructuralPartialEq for Reference
[src]
impl<'_> TryFrom<&'_ str> for Reference
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(string: &str) -> Result<Self, Self::Error>
[src]
impl TryFrom<String> for Reference
[src]
Auto Trait Implementations
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnwindSafe for Reference
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,