pub struct SceneNode {
pub id: NodeId,
pub kind: NodeKind,
pub props: Properties,
pub use_styles: SmallVec<[NodeId; 2]>,
pub constraints: SmallVec<[Constraint; 2]>,
pub animations: SmallVec<[AnimKeyframe; 2]>,
pub spec: Option<String>,
pub comments: Vec<String>,
pub place: Option<(HPlace, VPlace)>,
pub locked: bool,
}Expand description
A single node in the scene graph.
Fields§
§id: NodeIdThe node’s ID (e.g. @login_form). Anonymous nodes get auto-IDs.
kind: NodeKindWhat kind of element this is.
props: PropertiesInline style overrides on this node.
use_styles: SmallVec<[NodeId; 2]>Named style references (use: base_text).
constraints: SmallVec<[Constraint; 2]>Constraint-based positioning.
animations: SmallVec<[AnimKeyframe; 2]>Animations attached to this node.
spec: Option<String>Markdown spec content (spec { ... } block, also accepts legacy note).
comments: Vec<String>Line comments (# text) that appeared before this node in the source.
Preserved across parse/emit round-trips so format passes don’t delete them.
place: Option<(HPlace, VPlace)>9-position placement of this child within its parent.
None = default positioning (auto-center for text, origin for others).
locked: boolWhether this node is locked (prevents move, resize, delete on canvas).
Parsed from locked: true in the FD format.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SceneNode
impl<'de> Deserialize<'de> for SceneNode
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SceneNode
impl RefUnwindSafe for SceneNode
impl Send for SceneNode
impl Sync for SceneNode
impl Unpin for SceneNode
impl UnsafeUnpin for SceneNode
impl UnwindSafe for SceneNode
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