pub struct TemplateSourceV1 {Show 17 fields
pub filemaker: String,
pub model: ModelKind,
pub id: String,
pub page: Option<PageSource>,
pub collision: Option<CollisionSource>,
pub includes: Vec<IncludeSource>,
pub components: BTreeMap<String, ComponentSource>,
pub themes: BTreeMap<String, ThemeSource>,
pub theme: Option<String>,
pub style: StyleSource,
pub styles: BTreeMap<String, StyleSource>,
pub guides: BTreeMap<String, Length>,
pub regions: BTreeMap<String, RegionSource>,
pub exclusions: BTreeMap<String, ExclusionSource>,
pub data_schema: BTreeMap<String, DataFieldSource>,
pub elements: Vec<ElementSource>,
pub ai: Option<AiSourcePolicy>,
}Expand description
Version-one YAML frontend. This is never renderer input.
Fields§
§filemaker: StringMust equal "1.0".
model: ModelKindSource model.
id: StringStable logical template ID.
page: Option<PageSource>Optional page/canvas declaration.
collision: Option<CollisionSource>Document-wide collision policy inherited by every page.
includes: Vec<IncludeSource>Explicit includes expanded before IR construction.
components: BTreeMap<String, ComponentSource>Reusable component declarations.
themes: BTreeMap<String, ThemeSource>Theme token declarations.
theme: Option<String>Explicit active theme name.
style: StyleSourceTemplate-level style applied after the active theme.
styles: BTreeMap<String, StyleSource>Named styles.
guides: BTreeMap<String, Length>Named guides.
regions: BTreeMap<String, RegionSource>Named layout regions.
exclusions: BTreeMap<String, ExclusionSource>Named non-painted collision geometry repeated on every page.
data_schema: BTreeMap<String, DataFieldSource>Typed input data schema.
elements: Vec<ElementSource>Root elements in stable source order.
ai: Option<AiSourcePolicy>Optional author intent for AI adapters. Core does not interpret it.
Implementations§
Source§impl TemplateSourceV1
impl TemplateSourceV1
Sourcepub fn parse_yaml(bytes: &[u8], limits: &ResourceLimits) -> Result<Self>
pub fn parse_yaml(bytes: &[u8], limits: &ResourceLimits) -> Result<Self>
Parses a bounded strict YAML document and validates the exact schema version.
Sourcepub fn validate(&self, limits: &ResourceLimits) -> Result<()>
pub fn validate(&self, limits: &ResourceLimits) -> Result<()>
Validates frontend-only invariants before include/component expansion.
Sourcepub fn to_ir(
&self,
presets: &PresetRegistry,
limits: &ResourceLimits,
) -> Result<TemplateIr>
pub fn to_ir( &self, presets: &PresetRegistry, limits: &ResourceLimits, ) -> Result<TemplateIr>
Expands the already validated source into a Rust-native template IR.
Includes and components with arguments are handled by Compiler; this
direct conversion accepts only a source that is already self-contained.
Trait Implementations§
Source§impl Clone for TemplateSourceV1
impl Clone for TemplateSourceV1
Source§fn clone(&self) -> TemplateSourceV1
fn clone(&self) -> TemplateSourceV1
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TemplateSourceV1
impl Debug for TemplateSourceV1
Source§impl<'de> Deserialize<'de> for TemplateSourceV1
impl<'de> Deserialize<'de> for TemplateSourceV1
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>,
Source§impl PartialEq for TemplateSourceV1
impl PartialEq for TemplateSourceV1
Source§impl Serialize for TemplateSourceV1
impl Serialize for TemplateSourceV1
impl StructuralPartialEq for TemplateSourceV1
Auto Trait Implementations§
impl Freeze for TemplateSourceV1
impl RefUnwindSafe for TemplateSourceV1
impl Send for TemplateSourceV1
impl Sync for TemplateSourceV1
impl Unpin for TemplateSourceV1
impl UnsafeUnpin for TemplateSourceV1
impl UnwindSafe for TemplateSourceV1
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.