Skip to main content

ElementDef

Struct ElementDef 

Source
pub struct ElementDef {
    pub name: &'static str,
    pub jsx_own: &'static [&'static str],
    pub lua_own: &'static [&'static str],
    pub jsx_rows: Option<&'static [&'static str]>,
    pub lua_rows: Option<&'static [&'static str]>,
    pub jsx: &'static str,
    pub lua: &'static str,
    pub c: &'static str,
    pub odin: &'static str,
    pub doc: &'static str,
}
Expand description

An element (node type) and its spelling in each binding. Elements are hand-lowered per binding (their shapes differ: JSX children, Lua tables, C calls with body callbacks), so this table is documentation and a checklist, not a code generator’s input.

Fields§

§name: &'static str§jsx_own: &'static [&'static str]

The props this element lowers itself, which are therefore in neither PROPS nor CUSTOM: <edit initial multiline>, <image src>. They ride in the same prop list as the node’s, so a binding needs them to tell a legitimate element prop from a misspelling (see known_prop) — JSX’s spellings here, Lua’s below.

§lua_own: &'static [&'static str]

The same for a Lua node table.

§jsx_rows: Option<&'static [&'static str]>

The schema rows this element reads, or None for every one. A composite whose look is its spec — the stock button, whose padding, colours and radius are widgets::button_spec — cannot take the whole prop list: dir alone rebuilds the spec from nothing. It names the rows it reads instead, and a binding drops the rest with a warning that says which rows it does take (known_prop, diag::unknown_prop). JSX spellings here, Lua’s below.

§lua_rows: Option<&'static [&'static str]>§jsx: &'static str§lua: &'static str§c: &'static str§odin: &'static str

The Odin procedures (kui. and the name); checked by the Odin generator like the composites’ column.

§doc: &'static str

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.