testcontainers-build 0.1.0

Build Testcontainers images from folders, remote contexts, and pluggable Git providers
Documentation
use crate::{BuildOptions, Result};
use async_trait::async_trait;

/// Define image build and removal operations.
/// Keep this implementation separate from source resolution.
#[async_trait]
pub trait ImageBuildBackend: Send + Sync {
    /// Build and load an image with the supplied reference.
    /// Keep the context available until this operation completes.
    async fn build(
        &self,
        context: &std::ffi::OsStr,
        reference: &str,
        options: &BuildOptions,
    ) -> Result<()>;

    /// Remove the supplied image reference.
    /// Do not remove containers that use the image.
    async fn remove(&self, reference: &str) -> Result<()>;
}