pub struct Manifest { /* private fields */ }
Expand description
Interface for accessing and manipulating Podman Manifest.
Implementations§
Source§impl Manifest
impl Manifest
Sourcepub async fn exists(&self) -> Result<bool>
pub async fn exists(&self) -> Result<bool>
Quick way to determine if a manifest exists by name or id.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.manifests().get("some-manifest").exists().await {
Ok(exists) => if exists {
println!("manifest exists!");
} else {
println!("manifest doesn't exists!");
},
Err(e) => eprintln!("check failed: {}", e),
}
};
Sourcepub async fn inspect(&self) -> Result<Schema2List>
pub async fn inspect(&self) -> Result<Schema2List>
Display details about this manifest list.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.manifests().get("my-manifest").inspect().await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};
Sourcepub async fn add_image(&self, opts: &ManifestImageAddOpts) -> Result<IdResponse>
pub async fn add_image(&self, opts: &ManifestImageAddOpts) -> Result<IdResponse>
Add an image to this manifest list.
Examples:
async {
use podman_api::Podman;
use podman_api::opts::ManifestImageAddOpts;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
let manifest = podman.manifests().get("my-manifest");
match manifest
.add_image(&ManifestImageAddOpts::builder().images(["centos"]).build())
.await
{
Ok(id) => println!("{:?}", id),
Err(e) => eprintln!("{}", e),
}
};
Sourcepub async fn remove_image(
&self,
digest: impl Into<String>,
) -> Result<ManifestRemoveReport>
pub async fn remove_image( &self, digest: impl Into<String>, ) -> Result<ManifestRemoveReport>
Remove an image digest from this manifest list.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman
.manifests()
.get("my-manifest")
.remove_image("sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc")
.await {
Ok(report) => println!("{:?}", report),
Err(e) => eprintln!("{}", e),
}
};
Sourcepub async fn push(&self, opts: &ManifestPushOpts) -> Result<IdResponse>
pub async fn push(&self, opts: &ManifestPushOpts) -> Result<IdResponse>
Push this manifest list to a registry.
Examples:
async {
use podman_api::Podman;
use podman_api::opts::ManifestPushOpts;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
let manifest = podman.manifests().get("my-manifest");
match manifest
.push(&ManifestPushOpts::builder("some-registry.addr").all(true).build())
.await
{
Ok(id) => println!("{:?}", id),
Err(e) => eprintln!("{}", e),
}
};
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Manifest
impl !RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl !UnwindSafe for Manifest
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