pub struct TeksiElement {
pub type_path: Path,
pub has_explicit_ctor: bool,
pub args: Vec<Expr>,
pub body: Vec<BodyItem>,
pub head_span: Span,
pub args_close: Option<Span>,
pub body_close: Option<Span>,
}Expand description
An element: Type[::ctor](args...) { body }.
Fields§
§type_path: PathThe full callable path the user wrote. Button("x") stores
Button; Button::new(lit!("x")) stores the whole
Button::new_literal path. Lowering appends ::new only when
has_explicit_ctor is false.
has_explicit_ctor: boolTrue when the user named a constructor explicitly (a lowercase
last path segment, per Rust naming convention). Lowering then
calls the path as-is without appending ::new.
args: Vec<Expr>Positional arguments between the parens after the type path.
Empty when the user wrote VStack with no parens (equivalent to
VStack()).
body: Vec<BodyItem>Body items in source order.
head_span: SpanSpan of the type path’s first segment — used for error reporting on constructor typos.
args_close: Option<Span>Span of the closing ) after the args, if the user wrote any
args parens (including empty ()). None when no arg parens
were written. Consumers (e.g. the formatter) use this to find
the exact byte offset just past the args.
body_close: Option<Span>Span of the closing } of the body, if the user wrote any body
braces (including empty {}). None when no body braces were
written. Consumers use this to find the exact end of the body
for trivia attribution.