Enum rustainers::runner::Runner
source · #[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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 exec<I, S>(
&self,
container: &Container<I>,
exec_command: impl IntoIterator<Item = S> + Debug
) -> Result<(), RunnerError>where
S: Into<String>,
I: ToRunnableContainer,
pub async fn exec<I, S>( &self, container: &Container<I>, exec_command: impl IntoIterator<Item = S> + Debug ) -> Result<(), RunnerError>where S: Into<String>, I: ToRunnableContainer,
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,
Trait Implementations§
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more