pub struct ContainerConfig {
pub image: String,
pub tag: String,
pub name: Option<String>,
pub env: HashMap<String, String>,
pub ports: HashMap<u16, u16>,
pub wait_timeout_secs: u64,
}Expand description
Docker container configuration
Fields§
§image: StringDocker image
tag: StringImage tag
name: Option<String>Container name
env: HashMap<String, String>Environment variables
ports: HashMap<u16, u16>Port mappings (host_port -> container_port)
wait_timeout_secs: u64Wait for container to be ready
Implementations§
Source§impl ContainerConfig
impl ContainerConfig
Sourcepub fn new(image: impl Into<String>, tag: impl Into<String>) -> Self
pub fn new(image: impl Into<String>, tag: impl Into<String>) -> Self
Create new container config
§Examples
use armature_testing::docker::ContainerConfig;
let config = ContainerConfig::new("postgres", "15");Sourcepub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add environment variable
Sourcepub fn with_wait_timeout(self, seconds: u64) -> Self
pub fn with_wait_timeout(self, seconds: u64) -> Self
Set wait timeout
Sourcepub fn image_name(&self) -> String
pub fn image_name(&self) -> String
Get full image name
Trait Implementations§
Source§impl Clone for ContainerConfig
impl Clone for ContainerConfig
Auto Trait Implementations§
impl Freeze for ContainerConfig
impl RefUnwindSafe for ContainerConfig
impl Send for ContainerConfig
impl Sync for ContainerConfig
impl Unpin for ContainerConfig
impl UnsafeUnpin for ContainerConfig
impl UnwindSafe for ContainerConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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