use tokio::time::Duration;
#[derive(Debug, Eq, PartialEq, Clone)]
pub enum WaitFor {
Nothing,
StdOutMessage { message: String },
StdErrMessage { message: String },
Duration { length: Duration },
Healthcheck,
}
impl WaitFor {
pub fn message_on_stdout<S: Into<String>>(message: S) -> WaitFor {
WaitFor::StdOutMessage {
message: message.into(),
}
}
pub fn message_on_stderr<S: Into<String>>(message: S) -> WaitFor {
WaitFor::StdErrMessage {
message: message.into(),
}
}
pub fn seconds(length: u64) -> WaitFor {
WaitFor::Duration {
length: Duration::from_secs(length),
}
}
pub fn millis(length: u64) -> WaitFor {
WaitFor::Duration {
length: Duration::from_millis(length),
}
}
}