Skip to main content

Header

Trait Header 

Source
pub trait Header {
    // Required methods
    fn file(&self) -> &'static str;
    fn needed(&self, rawast: &RawAst) -> bool;
    fn guard(&self) -> &'static str;
    fn constants(&self, out: &mut String, tenv: &TyEnv, consts: &[&Const]);

    // Provided methods
    fn preamble(&self, _out: &mut String) { ... }
    fn structure(&self, _out: &mut String, _tenv: &TyEnv, _s: &Struct) { ... }
}
Expand description

One foreign language’s data-layer header.

Required Methods§

Source

fn file(&self) -> &'static str

Its file name under include/gen/.

Source

fn needed(&self, rawast: &RawAst) -> bool

Whether rawast needs it.

Source

fn guard(&self) -> &'static str

The include-guard macro.

Source

fn constants(&self, out: &mut String, tenv: &TyEnv, consts: &[&Const])

The constants, folded, in declaration order.

Provided Methods§

Source

fn preamble(&self, _out: &mut String)

Text after the guard, before the declarations.

Source

fn structure(&self, _out: &mut String, _tenv: &TyEnv, _s: &Struct)

One struct, laid out.

Implementors§