Struct podman_api::api::Image[][src]

pub struct Image<'podman> { /* fields omitted */ }
Expand description

Interface for accessing and manipulating Podman Image.

Api Reference

Implementations

Exports an interface exposing operations against a Image instance.

A getter for Image id

Api Reference

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),
}

Api Reference

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),
}

Api Reference

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),
}

Api Reference

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);
}

Api Reference

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);
}

Api Reference

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);
}

Api Reference

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);
}

Api Reference

Export this image.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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