#[non_exhaustive]pub struct CompileOptions {
pub entry_labels: Vec<String>,
pub require_text_ids: bool,
pub migrations: Option<String>,
pub frozen_schemas: Vec<(String, String)>,
}Expand description
Compile options. Built from Default with methods.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.entry_labels: Vec<String>Labels that the host starts from outside (module.label; if there is only one module, just the label name also works).
They are excluded from the warning label_falls_through (spec 4.5). When empty, labels named start are excluded as
start labels (the default of VmConfig::start).
require_text_ids: boolMakes plain lines, quote lines and option texts without a stable ID a compile error (missing_text_id). Text
replacement (localization; spec/host/05-texts.md) is keyed by stable IDs, so enable this for scripts that will be
translated. Disabled by default. It is checked as a writing rule even with a registry that ignores the sugar.
migrations: Option<String>The content of migrations.yomi (spec/language/07-migrate.md).
frozen_schemas: Vec<(String, String)>Frozen schema files (path such as schema/v2.yomi, content).
Implementations§
Source§impl CompileOptions
impl CompileOptions
Sourcepub fn require_text_ids(self, on: bool) -> Self
pub fn require_text_ids(self, on: bool) -> Self
Sets whether text lines without a stable ID are errors (CompileOptions::require_text_ids).
Sourcepub fn migrations(self, source: &str) -> Self
pub fn migrations(self, source: &str) -> Self
Sets the content of migrations.yomi. It can be given once.
Sourcepub fn frozen_schema_file(self, path: &str, source: &str) -> Self
pub fn frozen_schema_file(self, path: &str, source: &str) -> Self
Adds a frozen schema file. path is relative to the project root, like schema/v2.yomi.
Sourcepub fn entry_label(self, label: &str) -> Self
pub fn entry_label(self, label: &str) -> Self
Adds one start label (module.label).