Enum rustainers::WaitStrategy
source · #[non_exhaustive]pub enum WaitStrategy {
HealthCheck,
CustomHealthCheck(HealthCheck),
State(ContainerStatus),
HttpSuccess {
https: bool,
path: String,
container_port: Port,
},
ScanPort {
container_port: Port,
timeout: Duration,
},
LogMatch {
io: StdIoKind,
matcher: LogMatcher,
},
None,
}Expand description
Wait strategies
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
HealthCheck
With the image health check
CustomHealthCheck(HealthCheck)
With custom health check
State(ContainerStatus)
Wait for the container state
HttpSuccess
Wait until the HTTP call provide a successful status (e.g. 200 OK)
Fields
ScanPort
Wait until a socket is open
LogMatch
Wait until log match a pattern
None
Do not wait
Implementations§
source§impl WaitStrategy
impl WaitStrategy
sourcepub fn health_check() -> Self
pub fn health_check() -> Self
Wait with image healt check
sourcepub fn custom_health_check(health_check: HealthCheck) -> Self
pub fn custom_health_check(health_check: HealthCheck) -> Self
Wait with image healt check
sourcepub fn state(state: ContainerStatus) -> Self
pub fn state(state: ContainerStatus) -> Self
Wait for a state
sourcepub fn https(path: impl Into<String>) -> Self
pub fn https(path: impl Into<String>) -> Self
Wait for an successful HTTPS call on the 443 port
sourcepub fn scan_port(container_port: impl Into<Port>) -> Self
pub fn scan_port(container_port: impl Into<Port>) -> Self
Wait for a port to be open using a default timeout
sourcepub fn stdout_contains(str: impl Into<String>) -> Self
pub fn stdout_contains(str: impl Into<String>) -> Self
Wait for a log line in stdout contains a string
sourcepub fn stderr_contains(str: impl Into<String>) -> Self
pub fn stderr_contains(str: impl Into<String>) -> Self
Wait for a log line in stderr contains a string
Trait Implementations§
source§impl Clone for WaitStrategy
impl Clone for WaitStrategy
source§fn clone(&self) -> WaitStrategy
fn clone(&self) -> WaitStrategy
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Returns the “default value” for a type. Read more
source§impl Display for WaitStrategy
impl Display for WaitStrategy
source§impl From<ContainerStatus> for WaitStrategy
impl From<ContainerStatus> for WaitStrategy
source§fn from(value: ContainerStatus) -> Self
fn from(value: ContainerStatus) -> Self
Converts to this type from the input type.
source§impl From<HealthCheck> for WaitStrategy
impl From<HealthCheck> for WaitStrategy
source§fn from(value: HealthCheck) -> Self
fn from(value: HealthCheck) -> Self
Converts to this type from the input type.
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)