pub struct DhallBackend {
pub emit_annotations: bool,
}Expand description
The Dhall code generation backend.
Converts OxiLean IR constructs into Dhall configuration language output.
Fields§
§emit_annotations: boolWhether to emit types with full annotation (default true)
Implementations§
Source§impl DhallBackend
impl DhallBackend
Sourcepub fn emit_record(&self, record: &DhallRecord, indent: usize) -> String
pub fn emit_record(&self, record: &DhallRecord, indent: usize) -> String
Emit a DhallRecord to string.
Sourcepub fn emit_function(&self, func: &DhallFunction, indent: usize) -> String
pub fn emit_function(&self, func: &DhallFunction, indent: usize) -> String
Emit a DhallFunction to string.
Sourcepub fn make_schema(&self, fields: Vec<(&str, DhallType)>) -> DhallExpr
pub fn make_schema(&self, fields: Vec<(&str, DhallType)>) -> DhallExpr
Build a Dhall record schema (record type) from a field map.
Sourcepub fn make_list_map(
&self,
input_type: DhallType,
output_type: DhallType,
func: DhallExpr,
list: DhallExpr,
) -> DhallExpr
pub fn make_list_map( &self, input_type: DhallType, output_type: DhallType, func: DhallExpr, list: DhallExpr, ) -> DhallExpr
Build a List/map application.
Sourcepub fn make_natural_fold(
&self,
n: DhallExpr,
result_type: DhallType,
succ: DhallExpr,
zero: DhallExpr,
) -> DhallExpr
pub fn make_natural_fold( &self, n: DhallExpr, result_type: DhallType, succ: DhallExpr, zero: DhallExpr, ) -> DhallExpr
Build a Natural/fold-style loop body.
Sourcepub fn make_service_config(
&self,
enable: bool,
name: &str,
port: u64,
extra_fields: Vec<(String, DhallExpr)>,
) -> DhallExpr
pub fn make_service_config( &self, enable: bool, name: &str, port: u64, extra_fields: Vec<(String, DhallExpr)>, ) -> DhallExpr
Build a configuration record for a service-like schema.
Sourcepub fn make_enum(&self, variants: Vec<&str>) -> DhallType
pub fn make_enum(&self, variants: Vec<&str>) -> DhallType
Build a union type for an enumeration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DhallBackend
impl RefUnwindSafe for DhallBackend
impl Send for DhallBackend
impl Sync for DhallBackend
impl Unpin for DhallBackend
impl UnsafeUnpin for DhallBackend
impl UnwindSafe for DhallBackend
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