[−][src]Struct opencontainers::distribution::Registry
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]
&self,
url: &str,
headers: Option<&HeaderMap>
) -> Result<Response, RegistryError>
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
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto for T where
U: TryFrom<T>,
U: TryFrom<T>,