Struct podman_api::api::Containers [−][src]
pub struct Containers<'podman> { /* fields omitted */ }
Expand description
Handle for Podman Containers.
Implementations
Create a container with specified options.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
if let Err(e) = podman
.containers()
.create(
&ContainerCreateOpts::builder()
.image("debian:11")
.command(
["/usr/bin/httpd"]
)
.env([
("app", "web"),
])
.build(),
)
.await
{
eprintln!("{}", e);
}
Returns a list of containers.
Examples:
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
for container in podman
.containers()
.list(
&ContainerListOpts::builder()
.all(true)
.filter([ContainerListFilter::LabelKeyVal("app".into(), "web".into())])
.build(),
)
.await
.unwrap()
{
println!("{:?}", container);
}
Trait Implementations
Auto Trait Implementations
impl<'podman> !RefUnwindSafe for Containers<'podman>
impl<'podman> Send for Containers<'podman>
impl<'podman> Sync for Containers<'podman>
impl<'podman> Unpin for Containers<'podman>
impl<'podman> !UnwindSafe for Containers<'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