1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Container singletons for mae integration tests.
//!
//! Each sub-module owns one Docker container type and exposes:
//! - A static singleton (started lazily, guarded by `MAE_TESTCONTAINERS=1`).
//! - A per-test **isolation scope** (schema, keyspace, vhost, database) that
//! prevents cross-test interference.
//! - A [`teardown`](MaeContainer::teardown) function that stops the container
//! and clears the singleton so the next test-run starts fresh.
//!
//! All four container types implement [`MaeContainer`]. Call
//! [`teardown_all()`] from your global test teardown hook to stop every
//! container in one shot.
//!
//! # Stability contract for issue #40
//! The trait and module layout are intentionally fixed here. Issue #40 should
//! fill in the `start()` implementations for Redis, Neo4j, and RabbitMQ while
//! keeping the public API below unchanged.
use Future;
/// Common interface shared by every Mae container singleton.
///
/// Implementors are zero-sized unit types (`struct PostgresContainer;` etc.)
/// that act as namespaces — all state lives in module-level statics.
/// Stop **all** Mae container singletons.
///
/// Call this from your test harness's global teardown hook (e.g. a `#[dtor]`
/// or an `atexit`-style function registered in `main`).
///
/// Containers are torn down sequentially to avoid races on shared resources.
pub async