pub struct Networks { /* private fields */ }
Expand description
Handle for Podman Networks.
Implementations§
Source§impl Networks
impl Networks
Sourcepub async fn create(&self, opts: &NetworkCreateOpts) -> Result<Network>
pub async fn create(&self, opts: &NetworkCreateOpts) -> Result<Network>
Quick way to determine if a network exists by name or id.
Examples:
async {
use podman_api::Podman;
use podman_api::opts::NetworkCreateOpts;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman
.networks()
.create(&NetworkCreateOpts::builder().name("test-network").build())
.await
{
Ok(info) => println!("{:?}", info),
Err(e) => eprintln!("{}", e),
}
};
Sourcepub async fn list(&self, opts: &NetworkListOpts) -> Result<Vec<Network>>
pub async fn list(&self, opts: &NetworkListOpts) -> Result<Vec<Network>>
List network configurations.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.networks().list(&Default::default()).await {
Ok(networks) => println!("{:?}", networks),
Err(e) => eprintln!("{}", e),
}
};
Sourcepub async fn prune(
&self,
opts: &NetworkPruneOpts,
) -> Result<Vec<NetworkPruneReport>>
pub async fn prune( &self, opts: &NetworkPruneOpts, ) -> Result<Vec<NetworkPruneReport>>
Delete unused networks.
Examples:
async {
use podman_api::Podman;
let podman = Podman::unix("/run/user/1000/podman/podman.sock");
match podman.networks().prune(&Default::default()).await {
Ok(report) => println!("{:?}", report),
Err(e) => eprintln!("{}", e),
}
};
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Networks
impl !RefUnwindSafe for Networks
impl Send for Networks
impl Sync for Networks
impl Unpin for Networks
impl !UnwindSafe for Networks
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