Struct podman_api::api::Pods [−][src]
pub struct Pods<'podman> { /* fields omitted */ }
Expand description
Handle for Podman Pods.
Implementations
Returns a list of pods.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
for pod in podman
.pods()
.list(
&PodListOpts::builder()
.filter([PodListFilter::Status(PodStatus::Degraded)])
.build(),
)
.await
.unwrap()
{
println!("{:?}", pod);
}
Returns a list of pods.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.pods().prune().await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e);
}
pub async fn stats(
&self,
opts: &PodStatsOpts
) -> impl Stream<Item = Result<LibpodPodTopResponse>> + 'podman
pub async fn stats(
&self,
opts: &PodStatsOpts
) -> impl Stream<Item = Result<LibpodPodTopResponse>> + 'podman
Display a live stream of resource usage statistics for the containers in one or more pods.
Examples:
use futures_util::StreamExt;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
let stream = podman.pods().stats(&PodStatsOpts::builder().all(true).build())
while let Some(chunk) = stream.next().await {
match chunk{
Ok(chunk) => println!("{:?}", chunk),
Err(e) => eprintln!("{}", e);
}
}
Create a container with specified options.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match self
.podman
.containers()
.create(&PodCreateOpts::builder().name("my-pod").build())
.await
{
Ok(pod) => { /* do something with the pod */ }
Err(e) => eprintln!("{}", e),
}
Trait Implementations
Auto Trait Implementations
impl<'podman> !RefUnwindSafe for Pods<'podman>
impl<'podman> !UnwindSafe for Pods<'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