Trait dockertest::waitfor::WaitFor

source ·
pub trait WaitFor: Send + Sync + DynClone + Debug {
    // Required method
    fn wait_for_ready<'life0, 'async_trait>(
        &'life0 self,
        container: PendingContainer,
    ) -> Pin<Box<dyn Future<Output = Result<OperationalContainer, DockerTestError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn expected_state(&self) -> ContainerState { ... }
}
Expand description

Trait to wait for a container to be ready for service.

Required Methods§

source

fn wait_for_ready<'life0, 'async_trait>( &'life0 self, container: PendingContainer, ) -> Pin<Box<dyn Future<Output = Result<OperationalContainer, DockerTestError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Method implementation should return a future that resolves once the condition described by the implementing structure is fulfilled. Once this successfully resolves, the container is marked as ready.

Provided Methods§

source

fn expected_state(&self) -> ContainerState

What state the container is expected to be in after completing the wait_for_ready method, defaulting to the ContainerState::Running state. NOTE: This is only relevant for the container state api on ‘OperationalContainer’ (start, stop, kill) as we deny certain operations based on the assumed container state.

Implementors§