pub struct Registry<'a> { /* private fields */ }Expand description
Registry operations
Implementations§
Source§impl<'a> Registry<'a>
impl<'a> Registry<'a>
Sourcepub async fn login(&self, config: &RegistryConfig) -> Result<()>
pub async fn login(&self, config: &RegistryConfig) -> Result<()>
Authenticate with a registry
This is typically not needed for public pulls, but required for:
- Pushing images
- Pulling private images
- Accessing registries with rate limits
Sourcepub async fn search(
&self,
term: &str,
limit: Option<i64>,
) -> Result<Vec<ImageSearchResult>>
pub async fn search( &self, term: &str, limit: Option<i64>, ) -> Result<Vec<ImageSearchResult>>
Search for images in a registry
§Arguments
term- Search termlimit- Maximum number of results (default: 25)
§Example
let client = DockerClient::new()?;
let results = client.registry().search("nginx", Some(10)).await?;
for result in results {
println!("{}: {}", result.name, result.description.unwrap_or_default());
}Sourcepub async fn image_exists_locally(&self, image: &str) -> Result<bool>
pub async fn image_exists_locally(&self, image: &str) -> Result<bool>
Check if an image exists in the local registry cache
Sourcepub async fn list_local_images(&self, all: bool) -> Result<Vec<ImageSummary>>
pub async fn list_local_images(&self, all: bool) -> Result<Vec<ImageSummary>>
List all local images
Sourcepub async fn inspect_image(&self, image: &str) -> Result<ImageInspect>
pub async fn inspect_image(&self, image: &str) -> Result<ImageInspect>
Get detailed information about a local image
Sourcepub async fn remove_image(
&self,
image: &str,
force: bool,
noprune: bool,
) -> Result<()>
pub async fn remove_image( &self, image: &str, force: bool, noprune: bool, ) -> Result<()>
Remove an image from local cache
§Arguments
image- Image name or IDforce- Force removal even if image is in usenoprune- Do not delete untagged parents
Sourcepub async fn tag_image(
&self,
source: &str,
target_repo: &str,
target_tag: Option<&str>,
) -> Result<()>
pub async fn tag_image( &self, source: &str, target_repo: &str, target_tag: Option<&str>, ) -> Result<()>
Tag an image with a new name/tag
§Arguments
source- Source image nametarget_repo- Target repository nametarget_tag- Target tag (default: “latest”)
Sourcepub async fn prune_images(&self, dangling_only: bool) -> Result<u64>
pub async fn prune_images(&self, dangling_only: bool) -> Result<u64>
Auto Trait Implementations§
impl<'a> Freeze for Registry<'a>
impl<'a> !RefUnwindSafe for Registry<'a>
impl<'a> Send for Registry<'a>
impl<'a> Sync for Registry<'a>
impl<'a> Unpin for Registry<'a>
impl<'a> !UnwindSafe for Registry<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more