pub trait ImageDefaultLogConsumerExt<I>: Sized + ImageExt<I>where
I: Image,{
// Provided method
fn with_default_log_consumer(self) -> ContainerRequest<I> { ... }
}Provided Methods§
Sourcefn with_default_log_consumer(self) -> ContainerRequest<I>
fn with_default_log_consumer(self) -> ContainerRequest<I>
Given a container, this method will return a container request with a default log consumer.
Example:
use tokio::runtime::Runtime;
use testcontainers::{core::{IntoContainerPort, WaitFor}, runners::AsyncRunner, GenericImage, ImageExt};
use testcontainers_ext::ImageDefaultLogConsumerExt;
use anyhow::Result;
async fn test () -> Result<()> {
let container = GenericImage::new("redis", "7.2.4")
.with_exposed_port(6379.tcp())
.with_wait_for(WaitFor::message_on_stdout("Ready to accept connections"))
.with_default_log_consumer()
.start()
.await?;
Ok(())
}
Runtime::new().unwrap().block_on(test()).unwrap();Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.