pub struct DockerClient { /* private fields */ }Expand description
Docker client wrapper with connection handling
Implementations§
Source§impl DockerClient
impl DockerClient
Sourcepub fn new() -> Result<Self, DockerError>
pub fn new() -> Result<Self, DockerError>
Create new client connecting to local Docker daemon
Uses platform-appropriate socket (Unix socket on Linux/macOS). Returns a clear error if Docker is not running or accessible.
Sourcepub fn with_timeout(timeout_secs: u64) -> Result<Self, DockerError>
pub fn with_timeout(timeout_secs: u64) -> Result<Self, DockerError>
Create client with custom timeout (in seconds)
Use for long-running operations like image builds. Default timeout is 120 seconds; build timeout should be 600+ seconds.
Sourcepub async fn connect_remote(
host: &HostConfig,
host_name: &str,
) -> Result<Self, DockerError>
pub async fn connect_remote( host: &HostConfig, host_name: &str, ) -> Result<Self, DockerError>
Create client connecting to remote Docker daemon via SSH tunnel
Establishes an SSH tunnel to the remote host and connects Bollard to the forwarded local port.
§Arguments
host- Remote host configurationhost_name- Name of the host (for display purposes)
Sourcepub async fn connect_remote_with_timeout(
host: &HostConfig,
host_name: &str,
timeout_secs: u64,
) -> Result<Self, DockerError>
pub async fn connect_remote_with_timeout( host: &HostConfig, host_name: &str, timeout_secs: u64, ) -> Result<Self, DockerError>
Create remote client with custom timeout
Sourcepub async fn verify_connection(&self) -> Result<(), DockerError>
pub async fn verify_connection(&self) -> Result<(), DockerError>
Verify connection to Docker daemon
Returns Ok(()) if connected, descriptive error otherwise.
Sourcepub async fn version(&self) -> Result<String, DockerError>
pub async fn version(&self) -> Result<String, DockerError>
Get Docker version info (useful for debugging)
Auto Trait Implementations§
impl Freeze for DockerClient
impl !RefUnwindSafe for DockerClient
impl Send for DockerClient
impl Sync for DockerClient
impl Unpin for DockerClient
impl !UnwindSafe 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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request