Files
k-os/crates/manifest/src/lib.rs

38 lines
1.1 KiB
Rust

//! App manifests and the owner's decisions about them (see docs/apps.md):
//! parsed strictly from a TOML subset, into checked values. Pure: no
//! hardware, no kernel, no allocation.
#![no_std]
#![forbid(unsafe_code)]
mod capability;
mod decision;
mod fields;
mod manifest;
pub mod toml;
#[cfg(test)]
mod tests;
pub use capability::{Capabilities, Capability};
pub use decision::{Decision, MAX_TEXT as MAX_DECISION_TEXT};
pub use fields::{Accent, AppId, Command, FileName, Memory, Text, Version};
pub use manifest::Manifest;
/// Why a manifest or decision was refused; `line` is 1-based.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Error {
/// Not the TOML subset.
Syntax { line: usize },
/// A table, key or capability given twice.
Duplicate { line: usize },
/// A table, key or capability name that does not exist.
Unknown { line: usize },
/// A value of the right kind but not a valid one (a bad id, say).
Invalid { line: usize },
/// A required key is absent.
Missing(&'static str),
/// A capability both required and optional.
Conflict,
}