pub struct ContainerGuardSet { /* private fields */ }Expand description
Manages multiple containers as a group with coordinated lifecycle.
All containers are cleaned up when the set is dropped. This is useful for integration tests that require multiple services.
§Example
use docker_wrapper::testing::ContainerGuardSet;
use docker_wrapper::RedisTemplate;
let guards = ContainerGuardSet::new()
.with_network("test-network")
.add(RedisTemplate::new("redis"))
.keep_on_panic(true)
.start_all()
.await?;
// Check if container exists
assert!(guards.contains("redis"));
// Get container names
for name in guards.names() {
println!("Container: {}", name);
}Implementations§
Source§impl ContainerGuardSet
impl ContainerGuardSet
Sourcepub fn new() -> ContainerGuardSetBuilder
pub fn new() -> ContainerGuardSetBuilder
Create a new builder for a container guard set.
Sourcepub fn contains(&self, name: &str) -> bool
pub fn contains(&self, name: &str) -> bool
Check if a container with the given name exists in the set.
Trait Implementations§
Source§impl Default for ContainerGuardSet
impl Default for ContainerGuardSet
Auto Trait Implementations§
impl Freeze for ContainerGuardSet
impl !RefUnwindSafe for ContainerGuardSet
impl Send for ContainerGuardSet
impl !Sync for ContainerGuardSet
impl Unpin for ContainerGuardSet
impl !UnwindSafe for ContainerGuardSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more