[][src]Struct opencontainers::distribution::Registry

pub struct Registry {
    pub url: String,
    // some fields omitted
}

Represents a Registry implementing the OpenContainer Distribution Spec

Fields

url: String

Methods

impl Registry[src]

pub fn new(url: &str) -> Self[src]

Create a new registry interface given the URL to a registry.

Note: The URL should not contain a trailing slash.

Example

let registry = Registry::new("https://registry-1.docker.io");

Panics

This function can panic if the backing ClientBuilder cannot be initialized. This can happen if the native TLS backend cannot be initialized.

pub fn get(
    &self,
    url: &str,
    headers: Option<&HeaderMap>
) -> Result<Response, RegistryError>
[src]

Perform a GET request on the Registry, handling authentication.

Authentication

Authentication is handled transiently according to the Docker Registry Token Authentication Specification

Example

let endpoint = format!("{}/v2/", registry.url);
let response = registry.get(endpoint.as_str(), None)
    .expect("Could not perform API Version Check");
assert!(response.status().is_success());

pub fn image(&self, name: &str, reference: &str) -> Result<Image, RegistryError>[src]

Create an image handle for a given image

Example

let manifest = registry.image("library/hello-world", "latest")
    .expect("Could not get image");

Trait Implementations

impl Debug for Registry[src]

Auto Trait Implementations

impl Send for Registry

impl Sync for Registry

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err