pub struct Volumes { /* private fields */ }
Expand description
Handle for Podman Volumes.
Implementations§
Source§impl Volumes
impl Volumes
Sourcepub async fn create(
&self,
opts: &VolumeCreateOpts,
) -> Result<VolumeCreateResponse>
pub async fn create( &self, opts: &VolumeCreateOpts, ) -> Result<VolumeCreateResponse>
Create a volume with specified options.
Examples:
async {
use podman_api::Podman;
use podman_api::opts::VolumeCreateOpts;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman
.volumes()
.create(
&VolumeCreateOpts::builder()
.driver("my-driver")
.name("my-vol")
.build(),
)
.await
{
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};
Sourcepub async fn list(&self, opts: &VolumeListOpts) -> Result<Vec<Volume>>
pub async fn list(&self, opts: &VolumeListOpts) -> Result<Vec<Volume>>
Returns a list of volumes.
Examples:
async {
use podman_api::Podman;
use podman_api::opts::{VolumeListOpts, VolumeListFilter};
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
for volume in podman
.volumes()
.list(
&VolumeListOpts::builder()
.filter([VolumeListFilter::Driver("my-sd".into())])
.build(),
)
.await
.unwrap()
{
println!("{:?}", volume);
}
};
Sourcepub async fn prune(&self, opts: &VolumePruneOpts) -> Result<Vec<PruneReport>>
pub async fn prune(&self, opts: &VolumePruneOpts) -> Result<Vec<PruneReport>>
Delete unused volumes.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.volumes().prune(&Default::default()).await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Volumes
impl !RefUnwindSafe for Volumes
impl Send for Volumes
impl Sync for Volumes
impl Unpin for Volumes
impl !UnwindSafe for Volumes
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