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§
Sourcefn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
What it can render.
Sourcefn render(&self, env: &Environment) -> Result<Files>
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§
Sourcefn refusal(&self, env: &Environment) -> Option<String>
fn refusal(&self, env: &Environment) -> Option<String>
Why it would refuse env, if it would: the plan’s requirements against its
capabilities, without rendering.
Sourcefn run_manifest(&self, _env: &Environment) -> Result<Option<Manifest>>
fn run_manifest(&self, _env: &Environment) -> Result<Option<Manifest>>
Sourcefn run_manifests(&self, env: &Environment) -> Result<Vec<Placed>>
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".