[][src]Struct oci_registry_client::DockerRegistryClientV2

pub struct DockerRegistryClientV2 { /* fields omitted */ }

Client to fetch image manifests and download blobs.

DockerRegistryClientV2 provides functions to fetch manifests and download blobs from a OCI Image Registry (or a Docker Registry API V2).

Methods

impl DockerRegistryClientV2[src]

pub fn new<T: Into<String>>(service: T, api_url: T, oauth_url: T) -> Self[src]

Returns a new DockerRegistryClientV2.

Arguments

  • service - Name of a Image Registry Service (example: registry.docker.io)
  • api_url - Service HTTPS address (example: https://registry-1.docker.io)
  • auth_url - Address to get a OAuth 2.0 token for this service.

Example

let mut client = DockerRegistryClientV2::new(
    "registry.docker.io",
    "https://registry-1.docker.io",
    "https://auth.docker.io/token"
);

pub fn set_auth_token(&mut self, token: Option<AuthToken>)[src]

Set access token to authenticate subsequent requests.

pub async fn auth<'_, '_, '_, '_>(
    &'_ self,
    r#type: &'_ str,
    name: &'_ str,
    action: &'_ str
) -> Result<AuthToken, ErrorResponse>
[src]

Fetch a access token from auth_url for this service.

Arguments

  • type - Scope type (example: "repository").
  • name - Name of resource (example: "library/ubuntu").
  • action - List of actions separated by comma (example: "pull").

pub async fn version<'_>(&'_ self) -> Result<Version, ErrorResponse>[src]

Get API version.

pub async fn list_manifests<'_, '_, '_>(
    &'_ self,
    image: &'_ str,
    reference: &'_ str
) -> Result<ManifestList, ErrorResponse>
[src]

List manifests from given image and reference.

pub async fn manifest<'_, '_, '_>(
    &'_ self,
    image: &'_ str,
    reference: &'_ str
) -> Result<Manifest, ErrorResponse>
[src]

Get the image manifest.

pub async fn config<'_, '_, '_>(
    &'_ self,
    image: &'_ str,
    reference: &'_ Digest
) -> Result<Image, ErrorResponse>
[src]

Get the container config.

pub async fn blob<'_, '_, '_>(
    &'_ self,
    image: &'_ str,
    digest: &'_ Digest
) -> Result<Blob, ErrorResponse>
[src]

Retrieve the blob from the registry identified by digest.

Trait Implementations

impl Clone for DockerRegistryClientV2[src]

impl Debug for DockerRegistryClientV2[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,