Struct podman_api::api::Volume

source ·
pub struct Volume { /* private fields */ }
Expand description

Interface for accessing and manipulating Podman Volume.

Api Reference

Implementations§

Exports an interface exposing operations against a Volume instance.

A getter for Volume name

Api Reference

Quick way to determine if this volume exists.

Examples:

async {
    use podman_api::Podman;
    let podman = Podman::unix("/run/user/1000/podman/podman.sock");

    match podman.volumes().get("some_vol").exists().await {
        Ok(exists) => if exists {
            println!("volume exists!");
        } else {
            println!("volume doesn't exists!");
        },
        Err(e) => eprintln!("check failed: {}", e),
    }
};

Api Reference

Obtain low-level information about this volume.

Examples:

async {
    use podman_api::Podman;
    let podman = Podman::unix("/run/user/1000/podman/podman.sock");

    match podman.volumes().get("my-vol").inspect().await {
        Ok(info) => println!("{:?}", info),
        Err(e) => eprintln!("{}", e),
    }
};

Api Reference

Delete this volume. To forcefully remove an volume use Volume::remove.

Examples:

async {
    use podman_api::Podman;
    let podman = Podman::unix("/run/user/1000/podman/podman.sock");

    if let Err(e) = podman.volumes().get("my-vol").delete().await {
        eprintln!("{}", e);
    }
};

Api Reference

Remove this volume forcefully. To remove the volume normally use Volume::delete.

Examples:

async {
    use podman_api::Podman;
    let podman = Podman::unix("/run/user/1000/podman/podman.sock");

    if let Err(e) = podman.volumes().get("my-vol").remove().await {
        eprintln!("{}", e);
    }
};

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

Returns the argument unchanged.

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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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