Skip to content

vox-mesh-policy API Reference (generated)

Crate: vox-mesh-policy · Version: 0.6.0 · Target: Library (lib.rs)

Parses and pretty-prints donations.vox mesh policy files; defines WorkerDonationPolicy.

Parse, edit, and pretty-print donations.vox policy files.

The policy file is first-class Vox source. This crate wraps vox-compiler parse → WorkerDonationPolicy extraction and owns the pretty-print round-trip.

DependencyKind
vox-mesh-typesNormal
ModuleDescription
models—
parse—
print—
Dependency Topology, diagram 13 nodes, 2 edges: vox-mesh-policy → vox-mesh-types; vox-orchestrator → vox-mesh-policyvox-mesh-policyvox-mesh-typesvox-orchestrator
Diagram source
graph {
direction: right
node vox_mesh_policy: "vox-mesh-policy"
node vox_mesh_types: "vox-mesh-types"
vox_mesh_policy -> vox_mesh_types
node vox_orchestrator: "vox-orchestrator"
vox_orchestrator -> vox_mesh_policy
}
Consumer CrateRole
vox-orchestratorDirect workspace dependent
KindSymbolSignatureSourceDescription
enumparse::ParseErrorpub enum ParseErrorcrates/vox-mesh-policy/src/parse.rs#L8-L18—
fnparse::load_policypub fn load_policy(path: &Path) -> Result<WorkerDonationPolicy, ParseError>crates/vox-mesh-policy/src/parse.rs#L25-L31Load and parse a donations.vox policy file. The file uses Vox literal syntax for each field. This parser extracts the key-value assignments from the file and maps them to WorkerDonationPolicy.
fnparse::parse_sourcepub fn parse_source(src: &str, origin: &str) -> Result<WorkerDonationPolicy, ParseError>crates/vox-mesh-policy/src/parse.rs#L49Parse a donations.vox source string into a WorkerDonationPolicy. The canonical format for donations.vox is a set of Vox let bindings: text let nsfw_allowed = false let max_job_duration_secs = 3600 let public_mesh_opt_in = false let min_priority = 0 Slot declarations use a slot keyword: text slot gpu { max_concurrent = 2, weight_pct = 60 } slot cpu { max_concurrent = 4, weight_pct = 40 } Unknown keys are ignored for forward compatibility.
fnprint::pretty_printpub fn pretty_print(policy: &WorkerDonationPolicy) -> Stringcrates/vox-mesh-policy/src/print.rs#L11-L92Render a WorkerDonationPolicy as canonical donations.vox source. The output is deterministic: slots are ordered as given, booleans use lowercase literals, comments are placed at the top. Trailing comments from the original source are not preserved (this is a known limitation; a full AST round-trip is a future task).