pub enum WaitStrategy {
NoWait,
WaitForDuration(u64),
WaitUntilConsoleOutputContains(String, u64),
WaitForHttpHealthCheck(String, u64),
WaitForGrpcHealthCheck(String, u64),
}Expand description
Represents the strategy to wait for a container to reach a certain state.
This enum defines different strategies to be used when waiting for a container to be ready or to achieve a certain condition. It can be used to specify how a container’s readiness should be checked before considering it fully started and operational.
Variants:
-
NoWait: Do not wait. This variant indicates that the container should be considered ready immediately after it is started, without any delay or additional checks. -
WaitForDuration(duration: u64): Wait for a fixed duration. This variant takes au64value representing the number of seconds to wait before considering the container ready. This strategy is useful when a container is known to take a certain time to initialize. -
WaitUntilConsoleOutputContains(expected_output: String, timeout: u64): Wait until the container’s console output contains a specific string or until a timeout occurs. This variant takes aStringrepresenting the expected output to wait for and au64representing the timeout in seconds. This strategy is useful for containers that emit a specific log message or signal when they are ready. -
WaitForHttpHealthCheck(url: String, timeout: u64): Wait until an HTTP request to the given URL returns a 200 status code or until a timeout occurs. This variant takes aStringrepresenting the URL to make the request to and au64representing the timeout in seconds. This strategy is useful for containers that expose an HTTP server and indicate their readiness by returning a 200 status code. -
WaitForGrpcHealthCheck(url: String, timeout: u64): Wait until a gRPC request to the given URL returns a successful response or until a timeout occurs. This variant takes aStringrepresenting the URL to make the request to and au64representing the timeout in seconds. This strategy is useful for containers that expose a gRPC server and indicate their readiness by returning a successful response.
Note that the usage of these strategies depends on the specific requirements of the container and the context in which it is being started.
Variants§
NoWait
WaitForDuration(u64)
WaitUntilConsoleOutputContains(String, u64)
WaitForHttpHealthCheck(String, u64)
WaitForGrpcHealthCheck(String, u64)
Trait Implementations§
Source§impl Clone for WaitStrategy
impl Clone for WaitStrategy
Source§fn clone(&self) -> WaitStrategy
fn clone(&self) -> WaitStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WaitStrategy
impl Debug for WaitStrategy
Source§impl Default for WaitStrategy
impl Default for WaitStrategy
Source§fn default() -> WaitStrategy
fn default() -> WaitStrategy
Source§impl Display for WaitStrategy
impl Display for WaitStrategy
Source§impl Hash for WaitStrategy
impl Hash for WaitStrategy
Source§impl Ord for WaitStrategy
impl Ord for WaitStrategy
Source§fn cmp(&self, other: &WaitStrategy) -> Ordering
fn cmp(&self, other: &WaitStrategy) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for WaitStrategy
impl PartialEq for WaitStrategy
Source§impl PartialOrd for WaitStrategy
impl PartialOrd for WaitStrategy
impl Eq for WaitStrategy
impl StructuralPartialEq for WaitStrategy
Auto Trait Implementations§
impl Freeze for WaitStrategy
impl RefUnwindSafe for WaitStrategy
impl Send for WaitStrategy
impl Sync for WaitStrategy
impl Unpin for WaitStrategy
impl UnwindSafe for WaitStrategy
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request