Skip to main content

Backend

Trait Backend 

Source
pub trait Backend: Sync {
    // Required methods
    fn target(&self) -> Target;
    fn capabilities(&self) -> Capabilities;
    fn render(&self, env: &Environment) -> Result<Files>;

    // Provided methods
    fn refusal(&self, env: &Environment) -> Option<String> { ... }
    fn run_manifest(&self, _env: &Environment) -> Result<Option<Manifest>> { ... }
    fn run_manifests(&self, env: &Environment) -> Result<Vec<Placed>> { ... }
}
Expand description

A target’s renderer.

Required Methods§

Source

fn target(&self) -> Target

The target it renders.

Source

fn capabilities(&self) -> Capabilities

What it can render.

Source

fn render(&self, env: &Environment) -> Result<Files>

The environment’s files.

§Errors

Error::Refused (without writing anything) when the environment needs a capability the backend lacks; Error::Unsupported for a limit of the backend’s own target.

Provided Methods§

Source

fn refusal(&self, env: &Environment) -> Option<String>

Why it would refuse env, if it would: the plan’s requirements against its capabilities, without rendering.

Source

fn run_manifest(&self, _env: &Environment) -> Result<Option<Manifest>>

The run manifest the Isothrum runner executes (.isoloom/<target>/run.json), for a target that has one; its lab.message is left to the caller, who fills it from the resolved snapshot. None for the targets that have none yet.

§Errors

The backend’s Error when the environment can’t run on its target.

Source

fn run_manifests(&self, env: &Environment) -> Result<Vec<Placed>>

Every run manifest of the target, each with the folder it goes in under the target’s own: docker-vm has two, one per way it makes its VM (docker-vm/run.json with Vagrant, docker-vm/proxmox/run.json with Terraform). By default, Backend::run_manifest’s, in the target’s folder.

§Errors

The backend’s Error when the environment can’t run on its target.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§