#[non_exhaustive]pub enum Runner {
    Docker(Docker),
    Podman(Podman),
    Nerdctl(Nerdctl),
}Expand description
The test containers runner
Use the Runner::auto, Runner::docker, Runner::podman, Runner::nerdctl functions
to create your runner
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
Source§impl Runner
 
impl Runner
Sourcepub fn auto() -> Result<Self, RunnerError>
 
pub fn auto() -> Result<Self, RunnerError>
Sourcepub fn docker() -> Result<Self, RunnerError>
 
pub fn docker() -> Result<Self, RunnerError>
Create a docker runner
§Errors
Fail if the docker command is not found Fail if the docker command version is unsupported
Sourcepub fn podman() -> Result<Self, RunnerError>
 
pub fn podman() -> Result<Self, RunnerError>
Create a podman runner
§Errors
Fail if the podman command is not found Fail if the podman command version is unsupported
Sourcepub fn nerdctl() -> Result<Self, RunnerError>
 
pub fn nerdctl() -> Result<Self, RunnerError>
Create a nerdctl runner
§Errors
Fail if the nerdctl command is not found Fail if the nerdctl command version is unsupported
Source§impl Runner
 
impl Runner
Sourcepub async fn start<I>(&self, image: I) -> Result<Container<I>, RunnerError>where
    I: ToRunnableContainer,
 
pub async fn start<I>(&self, image: I) -> Result<Container<I>, RunnerError>where
    I: ToRunnableContainer,
Sourcepub async fn start_with_options<I>(
    &self,
    image: I,
    options: RunOption,
) -> Result<Container<I>, RunnerError>where
    I: ToRunnableContainer,
 
pub async fn start_with_options<I>(
    &self,
    image: I,
    options: RunOption,
) -> Result<Container<I>, RunnerError>where
    I: ToRunnableContainer,
Sourcepub async fn create_network(
    &self,
    name: impl Into<String>,
) -> Result<Network, RunnerError>
 
pub async fn create_network( &self, name: impl Into<String>, ) -> Result<Network, RunnerError>
Sourcepub async fn create_volume(
    &self,
    name: impl Into<String>,
) -> Result<VolumeName, RunnerError>
 
pub async fn create_volume( &self, name: impl Into<String>, ) -> Result<VolumeName, RunnerError>
Sourcepub async fn network_ip<I>(
    &self,
    container: &Container<I>,
    network: &Network,
) -> Result<Ipv4Addr, RunnerError>where
    I: ToRunnableContainer,
 
pub async fn network_ip<I>(
    &self,
    container: &Container<I>,
    network: &Network,
) -> Result<Ipv4Addr, RunnerError>where
    I: ToRunnableContainer,
Get the container IP for a custom network
§Errors
Fail if the network is not custom Fail if the IP is not found Could fail if we cannot execute the inspect command
Sourcepub async fn container_host_ip(&self) -> Result<Ipv4Addr, RunnerError>
 
pub async fn container_host_ip(&self) -> Result<Ipv4Addr, RunnerError>
Sourcepub async fn exec<I, S>(
    &self,
    container: &Container<I>,
    exec_command: impl IntoIterator<Item = S> + Debug,
) -> Result<String, RunnerError>
 
pub async fn exec<I, S>( &self, container: &Container<I>, exec_command: impl IntoIterator<Item = S> + Debug, ) -> Result<String, RunnerError>
Sourcepub fn stop<I>(&self, container: &Container<I>) -> Result<(), RunnerError>where
    I: ToRunnableContainer,
 
pub fn stop<I>(&self, container: &Container<I>) -> Result<(), RunnerError>where
    I: ToRunnableContainer,
Stop the container
This method is call during the crate::Container drop if it’s not detached
§Errors
Fail if we cannot launch the container
Source§impl Runner
 
impl Runner
Sourcepub async fn compose_start<I>(
    &self,
    images: I,
) -> Result<ComposeContainers<I>, RunnerError>where
    I: ToRunnableComposeContainers,
 
pub async fn compose_start<I>(
    &self,
    images: I,
) -> Result<ComposeContainers<I>, RunnerError>where
    I: ToRunnableComposeContainers,
Run a compose container with the default options
§Errors
Fail if the compose containers cannot be started
Sourcepub async fn compose_start_with_options<I>(
    &self,
    images: I,
    options: ComposeRunOption,
) -> Result<ComposeContainers<I>, RunnerError>where
    I: ToRunnableComposeContainers,
 
pub async fn compose_start_with_options<I>(
    &self,
    images: I,
    options: ComposeRunOption,
) -> Result<ComposeContainers<I>, RunnerError>where
    I: ToRunnableComposeContainers,
Source§impl Runner
 
impl Runner
Sourcepub async fn copy_to_volume(
    &self,
    volume: VolumeName,
    path: impl AsRef<Path>,
) -> Result<(), CopyError>
 
pub async fn copy_to_volume( &self, volume: VolumeName, path: impl AsRef<Path>, ) -> Result<(), CopyError>
Copy a file or a folder into a volume
§Errors
Fail if the path does not exists Fail if the path does not have a parent Fail if the path does not have a name Fail if the we cannot launch the copy into the containers
Trait Implementations§
impl Eq for Runner
impl StructuralPartialEq for Runner
Auto Trait Implementations§
impl Freeze for Runner
impl RefUnwindSafe for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl UnwindSafe for Runner
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.