pub enum WaitFor {
Nothing,
Log(LogWaitStrategy),
Duration {
length: Duration,
},
Healthcheck(HealthWaitStrategy),
Exit(ExitWaitStrategy),
}Expand description
Represents a condition that needs to be met before a container is considered ready.
Variants§
Nothing
An empty condition. Useful for default cases or fallbacks.
Log(LogWaitStrategy)
Wait for a certain message to appear in the container’s logs.
Duration
Wait for a certain amount of time.
Healthcheck(HealthWaitStrategy)
Wait for the container’s status to become healthy.
Exit(ExitWaitStrategy)
Wait for the container to exit.
Implementations§
Source§impl WaitFor
impl WaitFor
Sourcepub fn message_on_stdout(message: impl AsRef<[u8]>) -> WaitFor
pub fn message_on_stdout(message: impl AsRef<[u8]>) -> WaitFor
Wait for the message to appear on the container’s stdout.
Sourcepub fn message_on_stderr(message: impl AsRef<[u8]>) -> WaitFor
pub fn message_on_stderr(message: impl AsRef<[u8]>) -> WaitFor
Wait for the message to appear on the container’s stderr.
Sourcepub fn log(log_strategy: LogWaitStrategy) -> WaitFor
pub fn log(log_strategy: LogWaitStrategy) -> WaitFor
Wait for the message to appear on the container’s stdout.
Sourcepub fn healthcheck() -> WaitFor
pub fn healthcheck() -> WaitFor
Wait for the container to become healthy.
If you need to customize polling interval, use HealthWaitStrategy::with_poll_interval
and create the strategy WaitFor::Healthcheck manually.
Sourcepub fn exit(exit_strategy: ExitWaitStrategy) -> WaitFor
pub fn exit(exit_strategy: ExitWaitStrategy) -> WaitFor
Wait for the container to exit.
Sourcepub fn seconds(length: u64) -> WaitFor
pub fn seconds(length: u64) -> WaitFor
Wait for a certain amount of seconds.
Generally, it’s not recommended to use this method, as it’s better to wait for a specific condition to be met.
Sourcepub fn millis(length: u64) -> WaitFor
pub fn millis(length: u64) -> WaitFor
Wait for a certain amount of millis.
Generally, it’s not recommended to use this method, as it’s better to wait for a specific condition to be met.
Sourcepub fn millis_in_env_var(name: &'static str) -> WaitFor
pub fn millis_in_env_var(name: &'static str) -> WaitFor
Wait for a certain amount of millis specified in the environment variable.
Generally, it’s not recommended to use this method, as it’s better to wait for a specific condition to be met.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WaitFor
impl RefUnwindSafe for WaitFor
impl Send for WaitFor
impl Sync for WaitFor
impl Unpin for WaitFor
impl UnwindSafe for WaitFor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more