Skip to main content

DockerDeployment

Struct DockerDeployment 

Source
pub struct DockerDeployment { /* private fields */ }
Expand description

Manages Docker container lifecycle (create, start, stop, remove, inspect).

Implementations§

Source§

impl DockerDeployment

Source

pub fn new(config: DockerConfig) -> Result<Self>

Create a new deployment with the given config.

Source

pub fn with_status_callback<F>(self, f: F) -> Self
where F: Fn(&str) + Send + Sync + 'static,

Set status callback.

Source

pub fn is_started(&self) -> bool

Whether the deployment has started.

Source

pub fn container_id(&self) -> Option<&str>

The container ID (if started).

Source

pub fn container_name(&self) -> &str

The container name.

Source

pub fn host_port(&self) -> u16

The host port mapped to the container server port.

Source

pub fn auth_token(&self) -> &str

The auth token for the in-container server.

Source

pub async fn pull_image(&self) -> Result<()>

Pull the Docker image according to the pull policy.

Source

pub async fn start_container(&mut self) -> Result<()>

Start the container in detached mode.

Source

pub async fn start(&mut self) -> Result<()>

Full start flow: pull image + start container.

Source

pub async fn stop(&mut self) -> Result<()>

Stop and remove the container.

Source

pub async fn inspect(&self) -> Result<ContainerStatus>

Inspect the container and return its status.

Source

pub async fn remove(&mut self) -> Result<()>

Remove the container forcefully.

Trait Implementations§

Source§

impl Drop for DockerDeployment

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more