Skip to main content

NodeKind

Enum NodeKind 

Source
pub enum NodeKind {
    Root,
    Generic,
    Group,
    Frame {
        width: f32,
        height: f32,
        clip: bool,
        layout: LayoutMode,
    },
    Rect {
        width: f32,
        height: f32,
    },
    Ellipse {
        rx: f32,
        ry: f32,
    },
    Path {
        commands: Vec<PathCmd>,
    },
    Image {
        source: ImageSource,
        width: f32,
        height: f32,
        fit: ImageFit,
    },
    Text {
        content: String,
        max_width: Option<f32>,
    },
}
Expand description

The node kinds in the scene DAG.

Variants§

§

Root

Root of the document.

§

Generic

Generic placeholder — no visual shape assigned yet. Used for spec-only nodes: @login_btn { spec "CTA" }

§

Group

Organizational container (like Figma Group). Auto-sizes to children, no own styles or layout modes.

§

Frame

Frame — visible container with explicit size and optional clipping. Like a Figma frame: has fill/stroke, declared dimensions, clips overflow.

Fields

§width: f32
§height: f32
§clip: bool
§layout: LayoutMode
§

Rect

Rectangle.

Fields

§width: f32
§height: f32
§

Ellipse

Ellipse / circle.

Fields

§rx: f32
§ry: f32
§

Path

Freeform path (pen tool output).

Fields

§commands: Vec<PathCmd>
§

Image

Embedded image (R3.32).

Fields

§width: f32
§height: f32
§

Text

Text label. Optional max_width constrains horizontal extent for word wrapping (set via resize handle drag).

Fields

§content: String
§max_width: Option<f32>

Implementations§

Source§

impl NodeKind

Source

pub fn kind_name(&self) -> &'static str

Return the FD format keyword for this node kind.

Trait Implementations§

Source§

impl Clone for NodeKind

Source§

fn clone(&self) -> NodeKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NodeKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for NodeKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for NodeKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,