Struct podman_api::api::Pod [−][src]
pub struct Pod<'podman> { /* fields omitted */ }
Expand description
Interface for accessing and manipulating Podman Pod.
Implementations
Start this pod.
Parameters:
- detach_keys - Override the key sequence for detaching a pod. Format is a single character [a-Z] or ctrl- where is one of: a-z, @, ^, [, , or _.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").start().await {
eprintln!("{}", e);
}
Stop this pod.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").stop().await {
eprintln!("{}", e);
}
Stop this pod with a timeout.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").stop_with_timeout(10).await {
eprintln!("{}", e);
}
Return low-level information about this pod.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.pods().get("79c93f220e3e").inspect().await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e);
}
Send a signal to this pod.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").send_signal("SIGINT").await {
eprintln!("{}", e);
}
Kill this pod.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").kill().await {
eprintln!("{}", e);
}
Pause this pod.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").pause().await {
eprintln!("{}", e);
}
Unpause this pod
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").unpause().await {
eprintln!("{}", e);
}
Restart this pod.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").restart().await {
eprintln!("{}", e);
}
Delete this pod.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").delete().await {
eprintln!("{}", e);
}
Force remove this pod.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman.pods().get("79c93f220e3e").remove().await {
eprintln!("{}", e);
}
Quick way to determine if a pod exists by name or ID.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.pods().get("79c93f220e3e").exists().await {
Ok(exists) => if exists {
println!("pod exists!");
} else {
println!("pod doesn't exists!");
},
Err(e) => eprintln!("check failed: {}", e);
}
List processes inside this pod.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.pods().get("79c93f220e3e").top(&Default::default()).await {
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e);
}
pub async fn top_stream(
&self,
opts: &PodTopOpts
) -> impl Stream<Item = Result<LibpodPodTopResponse>> + 'podman
pub async fn top_stream(
&self,
opts: &PodTopOpts
) -> impl Stream<Item = Result<LibpodPodTopResponse>> + 'podman
List processes inside this pod.
Only supported as of version > 4.0
Examples:
use futures_util::StreamExt;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
let stream = podman.pods().get("79c93f220e3e").top_stream(&Default::default())
while let Some(chunk) = stream.next().await {
match chunk{
Ok(chunk) => println!("{:?}", chunk),
Err(e) => eprintln!("{}", e);
}
}
Trait Implementations
Auto Trait Implementations
impl<'podman> !RefUnwindSafe for Pod<'podman>
impl<'podman> !UnwindSafe for Pod<'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