pub struct Config {
pub output: OutputConfig,
pub docs: DocsConfig,
pub theme: BTreeMap<String, ThemeColor>,
pub externals: Vec<External>,
pub sections: BTreeMap<String, Value>,
pub path: Option<PathBuf>,
}Expand description
The parsed asbuilt.toml.
Unknown top-level tables are not an error: they are a front-end’s
([rust], say) and stay in sections for it to deserialize with its
own schema. Unknown keys inside [output] or an [[externals]]
entry are rejected.
use asbuilt_core::Config;
let config: Config = r#"
[output]
path = "arch/model.c4"
[rust]
include_tests = false
"#
.parse()
.unwrap();
assert_eq!(config.output.path, "arch/model.c4");
assert!(config.sections.contains_key("rust"));Fields§
§output: OutputConfig§docs: DocsConfig§theme: BTreeMap<String, ThemeColor>[theme]: a color per element kind (container, component, or
an external kind), emitted as LikeC4 element styles so the
diagrams come out in the consumer’s palette.
externals: Vec<External>§sections: BTreeMap<String, Value>§path: Option<PathBuf>Where this config was read from, for error messages. None for a
config parsed from a string or defaulted.
Implementations§
Source§impl Config
impl Config
Sourcepub fn light_theme(&self) -> BTreeMap<String, String>
pub fn light_theme(&self) -> BTreeMap<String, String>
The light color per themed kind, the emitter’s input.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more