Skip to main content

Crate litz_project

Crate litz_project 

Source
Expand description

One portable Litz project.

A project is the circuit, the source files that belong to it, and the few settings a runner needs. It is a single JSON document with a format tag and a version, so it can be written by one frontend, read by another, and kept in version control without a database.

The circuit itself stays diagram.json-shaped: this crate does not invent a second schematic format. What it adds is the parts a project needs around it — files, file groups for multi-board canvases, and options — plus the validation that keeps a hand-edited file from walking out of its own directory.

use litz_project::Project;

let mut project = Project::new("blink");
project.add_file("main.c", "int main(void) { return 0; }");
let text = project.to_json().unwrap();
let reopened = Project::from_json(&text).unwrap();
assert_eq!(reopened.name, "blink");
assert_eq!(reopened.files[0].name, "main.c");

Structs§

Options
Runner settings stored with the project.
Project
A complete project.
SourceFile
One source file in the project.

Enums§

ProjectError
Why a project file was refused.

Constants§

FORMAT
The tag every project file carries.
VERSION
The format revision this crate writes. Older files load unchanged.