fj_core/
core.rs

1//! Main entry point to the `fj-core` API
2//!
3//! See [`Core`].
4
5use crate::{layers::Layers, validation::ValidationConfig};
6
7/// An instance of the Fornjot core
8///
9/// This is the main entry point to `fj-core`'s API.
10#[derive(Default)]
11pub struct Core {
12    /// The layers of data that make up the state of a core instance
13    pub layers: Layers,
14}
15
16impl Core {
17    /// Construct an instance of `Instance`
18    pub fn new() -> Self {
19        Self::default()
20    }
21
22    /// Construct an instance of `Instance`, using the provided configuration
23    pub fn with_validation_config(config: ValidationConfig) -> Self {
24        let layers = Layers::with_validation_config(config);
25        Self { layers }
26    }
27}