pub struct ElementNode {
pub span: Span,
pub name: TokenStream,
pub props: Vec<(Ident, TokenStream)>,
pub children: Option<Box<Template>>,
}Expand description
A #[zyn::element] component invocation.
@my_getter(name = field.ident.clone(), ty = field.ty.clone())
@wrapper(title = "hello") { nested content }At expand time the name is PascalCase-converted, a struct literal is constructed
with the given props, and crate::Render::render is called on it.
Fields§
§span: SpanSource span of the @ token.
name: TokenStreamThe element name (may include :: path separators).
props: Vec<(Ident, TokenStream)>Named props as (name, value) pairs from (prop = val, ...).
children: Option<Box<Template>>Optional children block passed to the element’s children field.
Implementations§
Source§impl ElementNode
impl ElementNode
pub fn span(&self) -> Span
pub fn parse_with_ident( input: ParseStream<'_>, first_ident: Ident, ) -> Result<Self>
Trait Implementations§
Source§impl Expand for ElementNode
impl Expand for ElementNode
Source§impl From<ElementNode> for AtNode
impl From<ElementNode> for AtNode
Source§fn from(v: ElementNode) -> Self
fn from(v: ElementNode) -> Self
Converts to this type from the input type.
Source§impl Parse for ElementNode
impl Parse for ElementNode
fn parse(input: ParseStream<'_>) -> Result<Self>
Auto Trait Implementations§
impl Freeze for ElementNode
impl RefUnwindSafe for ElementNode
impl !Send for ElementNode
impl !Sync for ElementNode
impl Unpin for ElementNode
impl UnsafeUnpin for ElementNode
impl UnwindSafe for ElementNode
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