pub struct NetworkRef<'a> { /* private fields */ }Expand description
Reference to a specific network.
Implementations§
Source§impl<'a> NetworkRef<'a>
impl<'a> NetworkRef<'a>
Sourcepub async fn inspect(&self) -> Result<Network>
pub async fn inspect(&self) -> Result<Network>
Inspect the network to get detailed information.
Sourcepub async fn connect(&self, container: impl Into<String>) -> Result<()>
pub async fn connect(&self, container: impl Into<String>) -> Result<()>
Connect a container to this network.
§Example
use lmrc_docker::DockerClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = DockerClient::new()?;
client.networks()
.get("my-network")
.connect("my-container")
.await?;
Ok(())
}Auto Trait Implementations§
impl<'a> Freeze for NetworkRef<'a>
impl<'a> !RefUnwindSafe for NetworkRef<'a>
impl<'a> Send for NetworkRef<'a>
impl<'a> Sync for NetworkRef<'a>
impl<'a> Unpin for NetworkRef<'a>
impl<'a> !UnwindSafe for NetworkRef<'a>
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