Struct preserves_schema::compiler::CompilerConfig
source · pub struct CompilerConfig {
pub bundle: Map<ModulePath, (Schema, Purpose)>,
pub fully_qualified_module_prefix: String,
pub support_crate: String,
pub external_modules: Map<ModulePath, ExternalModule>,
pub plugins: Vec<Box<dyn Plugin>>,
pub rustfmt_skip: bool,
}
Expand description
Main entry point to the compiler.
Fields§
§bundle: Map<ModulePath, (Schema, Purpose)>
All known Schema modules, indexed by ModulePath and annotated with a Purpose.
fully_qualified_module_prefix: String
Fully-qualified Rust module prefix to use for each generated module.
support_crate: String
Rust module path to the preserves_schema::support module.
external_modules: Map<ModulePath, ExternalModule>
External modules for cross-referencing.
plugins: Vec<Box<dyn Plugin>>
Plugins active in this compiler instance.
rustfmt_skip: bool
If true, a directive is emitted in each module instructing rustfmt to ignore it.
Implementations§
source§impl CompilerConfig
impl CompilerConfig
sourcepub fn new(fully_qualified_module_prefix: String) -> Self
pub fn new(fully_qualified_module_prefix: String) -> Self
Construct a CompilerConfig configured to use fully_qualified_module_prefix
as the
Rust module prefix for generated code.
pub fn add_external_module(&mut self, m: ExternalModule)
pub fn load_schemas_and_bundles( &mut self, inputs: &Vec<PathBuf>, xrefs: &Vec<PathBuf> ) -> Result<()>
pub fn load_xref_bin( &mut self, prefix: &str, bundle_or_schema: &[u8] ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompilerConfig
impl !RefUnwindSafe for CompilerConfig
impl !Send for CompilerConfig
impl !Sync for CompilerConfig
impl Unpin for CompilerConfig
impl !UnwindSafe for CompilerConfig
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