[−][src]Struct oci_distribution::Client
The OCI client connects to an OCI registry and fetches OCI images.
An OCI registry is a container registry that adheres to the OCI Distribution specification. DockerHub is one example, as are ACR and GCR. This client provides a native Rust implementation for pulling OCI images.
Some OCI registries support completely anonymous access. But most require
at least an Oauth2 handshake. Typlically, you will want to create a new
client, and then run the auth()
method, which will attempt to get
a read-only bearer token. From there, pulling images can be done with
the pull_*
functions.
For true anonymous access, you can skip auth()
. This is not recommended
unless you are sure that the remote registry does not require Oauth2.
Implementations
impl Client
[src]
pub fn new(config: ClientConfig) -> Self
[src]
Create a new client with the supplied config
pub fn from_source(config_source: &impl ClientConfigSource) -> Self
[src]
Create a new client with the supplied config
pub async fn pull_image<'_, '_, '_>(
&'_ mut self,
image: &'_ Reference,
auth: &'_ RegistryAuth
) -> Result<ImageData>
[src]
&'_ mut self,
image: &'_ Reference,
auth: &'_ RegistryAuth
) -> Result<ImageData>
Pull an image and return the bytes
The client will check if it's already been authenticated and if not will attempt to do.
pub async fn fetch_manifest_digest<'_, '_, '_>(
&'_ mut self,
image: &'_ Reference,
auth: &'_ RegistryAuth
) -> Result<String>
[src]
&'_ mut self,
image: &'_ Reference,
auth: &'_ RegistryAuth
) -> Result<String>
Fetch a manifest's digest from the remote OCI Distribution service.
If the connection has already gone through authentication, this will use the bearer token. Otherwise, this will attempt an anonymous pull.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,