pub struct DockerClient { /* private fields */ }Implementations§
Source§impl DockerClient
impl DockerClient
pub fn new(docker_host: Option<&str>) -> Result<Self>
pub async fn create_container( &self, machine_id: &str, app_name: &str, config: &MachineConfig, ) -> Result<String>
pub async fn start_container(&self, container_id: &str) -> Result<()>
pub async fn stop_container( &self, container_id: &str, timeout: Option<i64>, ) -> Result<()>
pub async fn remove_container(&self, container_id: &str) -> Result<()>
pub async fn inspect_container( &self, container_id: &str, ) -> Result<ContainerInspectResponse>
Sourcepub async fn get_container_ports(&self, container_id: &str) -> Result<Vec<u16>>
pub async fn get_container_ports(&self, container_id: &str) -> Result<Vec<u16>>
Get the assigned host ports for a container
Since we use automatic port allocation (port 0), Docker assigns ephemeral ports. This function retrieves the actual assigned ports after container creation.
§Arguments
container_id- The Docker container ID
§Returns
Ok(Vec<u16>)- List of assigned host portsErr(...)- Failed to inspect container
Sourcepub async fn list_containers(
&self,
filters: Option<HashMap<String, Vec<String>>>,
) -> Result<Vec<ContainerSummary>>
pub async fn list_containers( &self, filters: Option<HashMap<String, Vec<String>>>, ) -> Result<Vec<ContainerSummary>>
List containers with optional filters
Trait Implementations§
Source§impl Clone for DockerClient
impl Clone for DockerClient
Source§fn clone(&self) -> DockerClient
fn clone(&self) -> DockerClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for DockerClient
impl !UnwindSafe for DockerClient
impl Freeze for DockerClient
impl Send for DockerClient
impl Sync for DockerClient
impl Unpin for DockerClient
impl UnsafeUnpin for DockerClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more