pub trait Backend {
type Printer: Printer;
const NAME: &'static str = <Self::Printer>::NAME;
// Required method
fn module_path(&self, module: &Module) -> Utf8PathBuf;
// Provided methods
fn printer(&self) -> Self::Printer { ... }
fn phases(&self) -> Vec<Box<dyn Phase>> { ... }
fn items_to_module(&self, items: Vec<Item>) -> Vec<Module> { ... }
}Expand description
A hax backend.
A backend is responsible for turning the hax AST into sources of a target language. It combines:
- a sequence of AST transformation phases, and
- a printer that generates textual output.
For example, we have F*, Coq, and Lean backends. Some are still in the old OCaml engine.
Provided Associated Constants§
Sourceconst NAME: &'static str = <Self::Printer>::NAME
const NAME: &'static str = <Self::Printer>::NAME
A short name identifying the backend.
By default, this is delegated to the associated printer’s Printer::NAME.
Required Associated Types§
Required Methods§
Sourcefn module_path(&self, module: &Module) -> Utf8PathBuf
fn module_path(&self, module: &Module) -> Utf8PathBuf
Compute the relative filesystem path where a given module should be written.
Provided Methods§
Sourcefn printer(&self) -> Self::Printer
fn printer(&self) -> Self::Printer
Construct a new printer instance.
By default this calls Default::default on the printer type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.