Skip to main content

compile

Function compile 

Source
pub fn compile(yaml_source: &str) -> Result<Vec<u8>, String>
Expand description

Compile a .faf YAML source string into .fafb binary bytes.

Extracts sections from the YAML and assembles them into the binary format with header, section data, and section table.

ยงExample

use faf_rust_sdk::binary::compile::compile;

let yaml = r#"
faf_version: 2.5.0
project:
  name: my-project
  goal: Build something great
instant_context:
  tech_stack: Rust, TypeScript
  key_files:
    - src/main.rs
"#;

let fafb_bytes = compile(yaml).unwrap();
assert_eq!(&fafb_bytes[0..4], b"FAFB");