pub struct DockerContainer { /* private fields */ }Expand description
Docker test container
Implementations§
Source§impl DockerContainer
impl DockerContainer
Sourcepub fn new(config: ContainerConfig) -> Self
pub fn new(config: ContainerConfig) -> Self
Create new Docker container
§Examples
use armature_testing::docker::*;
let config = ContainerConfig::new("postgres", "15")
.with_env("POSTGRES_PASSWORD", "test")
.with_port(5432, 5432);
let container = DockerContainer::new(config);Sourcepub fn is_docker_available() -> bool
pub fn is_docker_available() -> bool
Check if Docker is available
Sourcepub async fn start(&mut self) -> Result<(), DockerError>
pub async fn start(&mut self) -> Result<(), DockerError>
Start container
Sourcepub async fn stop(&mut self) -> Result<(), DockerError>
pub async fn stop(&mut self) -> Result<(), DockerError>
Stop container
Sourcepub fn container_id(&self) -> Option<&str>
pub fn container_id(&self) -> Option<&str>
Get container ID
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if container is running
Trait Implementations§
Source§impl Drop for DockerContainer
impl Drop for DockerContainer
Auto Trait Implementations§
impl Freeze for DockerContainer
impl RefUnwindSafe for DockerContainer
impl Send for DockerContainer
impl Sync for DockerContainer
impl Unpin for DockerContainer
impl UnsafeUnpin for DockerContainer
impl UnwindSafe for DockerContainer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<R, D> DepsPresent<D> for R
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging