Trait Server

Source
pub trait Server {
    type Config: Config + 'static;

    // Required method
    fn new(config: &Self::Config, container: &RunningContainer) -> Self;
}
Expand description

A running instance of a specific container generated by a Config.

Types that implement this trait are intended to have a one-to-one relationship with a Config as specified by Server::Config. When a Test is created it is passed one or more Configs which determine what containers are brought up during the test. A Server represents a running container within the context of a single test. This is reflected by the fact that a Server is created using a Config as well as the runtime data provided by a RunningContainer.

Types implementing this trait should provide as much utility to the end-user as possible for interacting with the running container. For example, if the container is a web server, this trait should provide functionality for obtaining it’s URL.

Required Associated Types§

Source

type Config: Config + 'static

Required Methods§

Source

fn new(config: &Self::Config, container: &RunningContainer) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§