Struct podman_api::api::Image [−][src]
pub struct Image<'podman> { /* fields omitted */ }
Expand description
Interface for accessing and manipulating Podman Image.
Implementations
Obtain low-level information about this image.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.images().get("debian").inspect().await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
Return parent layers of an image.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.images().get("debian").history().await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
Quick way to determine if a image exists by name or ID.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.images().get("debian").exists().await {
Ok(exists) => if exists {
println!("image exists!");
} else {
println!("image doesn't exists!");
},
Err(e) => eprintln!("check failed: {}", e),
}
Delete this image from local storage. To forcefully remove an image use
Image::remove
.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.images().get("debian").delete().await
eprintln!("{}", e);
}
Remove this image forcefully from local storage. To remove the image normally use
Image::delete
.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.images().get("debian").remove().await
eprintln!("{}", e);
}
Tag an image so that it becomes part of a repository.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman
.images()
.get("debian")
.tag(
&ImageTagOpts::builder()
.repo("my.custom.repo/debian")
.tag("1.0.0")
.build(),
)
.await
.unwrap()
{
println!("{:?}", image);
}
Untag an image. If repo and tag are not specified, all tags are removed from the image.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman
.images()
.get("debian")
.untag(
&ImageTagOpts::builder()
.repo("my.custom.repo/debian")
.tag("1.0.0")
.build(),
)
.await
.unwrap()
{
println!("{:?}", image);
}
Export this image.
Trait Implementations
Auto Trait Implementations
impl<'podman> !RefUnwindSafe for Image<'podman>
impl<'podman> !UnwindSafe for Image<'podman>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more