Struct rustainers::RunnableContainer
source · #[non_exhaustive]pub struct RunnableContainer { /* private fields */ }Expand description
Contains configuration require to create and run a container
Example
let runnable = RunnableContainer::builder()
.with_image(ImageName::new("redis"))
.with_wait_strategy(
HealthCheck::builder()
.with_command("redis-cli --raw incr ping")
.with_start_period(Duration::from_millis(96))
.with_interval(Duration::from_millis(96))
.build(),
)
.with_port_mappings([ExposedPort::new(6379)])
.build();See existings images for real usages.
Implementations§
source§impl RunnableContainer
impl RunnableContainer
sourcepub fn builder() -> RunnableContainerBuilder<((), (), (), (), (), ())>
pub fn builder() -> RunnableContainerBuilder<((), (), (), (), (), ())>
Create a builder for building RunnableContainer.
On the builder, call .image(...), .container_name(...)(optional), .command(...)(optional), .env(...)(optional), .wait_strategy(...)(optional), .port_mappings(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of RunnableContainer.
source§impl RunnableContainer
impl RunnableContainer
sourcepub fn descriptor(&self) -> String
pub fn descriptor(&self) -> String
Build the descriptor of an image (name + tag)
Trait Implementations§
source§impl Debug for RunnableContainer
impl Debug for RunnableContainer
Auto Trait Implementations§
impl !RefUnwindSafe for RunnableContainer
impl Send for RunnableContainer
impl Sync for RunnableContainer
impl Unpin for RunnableContainer
impl !UnwindSafe for RunnableContainer
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