pub struct ElementSource {Show 36 fields
pub id: String,
pub element_type: String,
pub component: Option<String>,
pub props: BTreeMap<String, Value>,
pub slots: BTreeMap<String, Vec<ElementSource>>,
pub x: Option<Length>,
pub y: Option<Length>,
pub width: Option<Length>,
pub height: Option<Length>,
pub constraints: LayoutConstraints,
pub align_x: Option<Alignment>,
pub align_y: Option<Alignment>,
pub text: Option<String>,
pub text_options: TextSourceOptions,
pub table: Option<TableSource>,
pub asset: Option<String>,
pub image: ImageOptions,
pub path: Vec<PathCommandSource>,
pub styles: Vec<String>,
pub style: StyleSource,
pub style_rules: Vec<ElementStyleRuleSource>,
pub transform: TransformSource,
pub layout: LayoutMode,
pub distribute: Distribution,
pub gap: Length,
pub binding: Option<String>,
pub when: Option<String>,
pub repeat: Option<String>,
pub anchors: BTreeMap<String, String>,
pub region: Option<String>,
pub children: Vec<ElementSource>,
pub locked: bool,
pub hidden: bool,
pub layer: String,
pub z_index: i32,
pub collision: Option<CollisionSource>,
/* private fields */
}Expand description
Declarative element frontend.
Fields§
§id: StringUnique stable ID.
element_type: StringElement type.
component: Option<String>Optional component to instantiate.
props: BTreeMap<String, Value>Component props.
slots: BTreeMap<String, Vec<ElementSource>>Named slot content supplied to a component instance.
x: Option<Length>Horizontal source coordinate.
y: Option<Length>Vertical source coordinate.
width: Option<Length>Source width.
height: Option<Length>Source height.
constraints: LayoutConstraintsMinimum, preferred, maximum, and aspect-ratio size intent.
align_x: Option<Alignment>Optional horizontal alignment inside the resolved container.
align_y: Option<Alignment>Optional vertical alignment inside the resolved container.
text: Option<String>Literal text before binding evaluation.
text_options: TextSourceOptionsText overflow, line, minimum-size, and writing-mode intent.
table: Option<TableSource>First-class table declaration, valid only for type: table.
asset: Option<String>Asset reference.
image: ImageOptionsImage crop, fit, focal-point, and EXIF behavior.
path: Vec<PathCommandSource>Simple vector path commands.
styles: Vec<String>Named style references in cascade order.
style: StyleSourceInline style.
style_rules: Vec<ElementStyleRuleSource>Ordered conditional styles evaluated after the compiled style layers.
transform: TransformSourceTranslation, rotation, scale, flip, mirror, and origin intent.
layout: LayoutModeLayout strategy.
distribute: DistributionDistribution of children on a flow’s primary axis.
gap: LengthGap between flow children.
binding: Option<String>Data binding expression.
when: Option<String>Visibility condition expression.
repeat: Option<String>Repeat array expression.
anchors: BTreeMap<String, String>Named anchors.
region: Option<String>Named containing region.
children: Vec<ElementSource>Child nodes.
locked: boolWhether runtime patches may modify this node.
Whether the node is initially hidden.
layer: StringVisual layer.
z_index: i32Visual order within a layer.
collision: Option<CollisionSource>Collision declaration independent from layer ordering.
Implementations§
Source§impl ElementSource
impl ElementSource
Sourcepub fn to_ir(&self, limits: &ResourceLimits) -> Result<ElementIr>
pub fn to_ir(&self, limits: &ResourceLimits) -> Result<ElementIr>
Validates and converts one static, self-contained source element to IR.
This compact boundary is suitable for programmatic and tool-driven
Canvas additions. Components, props, slots, named or conditional
styles, bindings, conditions, and repeats require the complete
crate::Compiler pipeline and are rejected here.
Trait Implementations§
Source§impl Clone for ElementSource
impl Clone for ElementSource
Source§fn clone(&self) -> ElementSource
fn clone(&self) -> ElementSource
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 ElementSource
impl Debug for ElementSource
Source§impl<'de> Deserialize<'de> for ElementSource
impl<'de> Deserialize<'de> for ElementSource
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 ElementSource
impl PartialEq for ElementSource
Source§impl Serialize for ElementSource
impl Serialize for ElementSource
impl StructuralPartialEq for ElementSource
Auto Trait Implementations§
impl Freeze for ElementSource
impl RefUnwindSafe for ElementSource
impl Send for ElementSource
impl Sync for ElementSource
impl Unpin for ElementSource
impl UnsafeUnpin for ElementSource
impl UnwindSafe for ElementSource
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.