Struct dockertest_server::test::Test
source · [−]pub struct Test {
pub configs: TypeMap,
pub compositions: Vec<Composition>,
}
Expand description
A single test which brings up one or more Servers.
A Test receives Configs via register
which
determines the servers that will be brought up when the test is executed.
The run
method is used to bring up the Servers and then run the
given test body.
The body of a test is determined by an async closure passed to the run
method. The closure will receive a TestInstance which can be used to
access the Servers that were created when the test was setup.
Fields
configs: TypeMap
compositions: Vec<Composition>
Implementations
sourceimpl Test
impl Test
sourcepub fn run<T, F>(self, fun: T) where
T: FnOnce(TestInstance) -> F + Send + 'static,
F: Future<Output = ()> + Send + 'static,
pub fn run<T, F>(self, fun: T) where
T: FnOnce(TestInstance) -> F + Send + 'static,
F: Future<Output = ()> + Send + 'static,
Brings up the Servers registered with this test and then runs the given test body.
The test body receives a TestInstance which can be used for accessing
any configured Servers through the server
method.
The test body is guaranteed to not execute until all configured
Servers are verified to be running and available. The scope of
the test body determines the life of the Servers: they are
created before the closure is run and destroyed after the closure exits.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Test
impl !Send for Test
impl !Sync for Test
impl Unpin for Test
impl !UnwindSafe for Test
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more