pub struct ContainerRef<'a> { /* private fields */ }Expand description
Reference to a specific container.
Implementations§
Source§impl<'a> ContainerRef<'a>
impl<'a> ContainerRef<'a>
Sourcepub async fn start(&self) -> Result<()>
pub async fn start(&self) -> Result<()>
Start the container.
§Example
use lmrc_docker::DockerClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = DockerClient::new()?;
client.containers().get("my-container").start().await?;
Ok(())
}Sourcepub async fn kill(&self, signal: Option<&str>) -> Result<()>
pub async fn kill(&self, signal: Option<&str>) -> Result<()>
Kill the container with optional signal.
Sourcepub async fn remove(&self, force: bool, remove_volumes: bool) -> Result<()>
pub async fn remove(&self, force: bool, remove_volumes: bool) -> Result<()>
Remove the container.
§Arguments
force- Force remove even if runningremove_volumes- Remove associated volumes
Sourcepub async fn inspect(&self) -> Result<ContainerInspectResponse>
pub async fn inspect(&self) -> Result<ContainerInspectResponse>
Inspect the container to get detailed information.
Auto Trait Implementations§
impl<'a> Freeze for ContainerRef<'a>
impl<'a> !RefUnwindSafe for ContainerRef<'a>
impl<'a> Send for ContainerRef<'a>
impl<'a> Sync for ContainerRef<'a>
impl<'a> Unpin for ContainerRef<'a>
impl<'a> !UnwindSafe for ContainerRef<'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