pub enum AtNode {
If(IfNode),
For(ForNode),
Match(MatchNode),
Element(ElementNode),
}Expand description
An @-prefixed statement in a zyn template.
See the at module for the syntax of each variant.
Variants§
If(IfNode)
@if (cond) { ... } @else if (...) { ... } @else { ... }
For(ForNode)
@for (item in expr) { ... } or @for (count) { ... }
Match(MatchNode)
@match (expr) { pattern => { ... }, ... }
Element(ElementNode)
@component_name(prop = val, ...) { children }
Implementations§
Source§impl AtNode
impl AtNode
Sourcepub fn is_if(&self) -> bool
pub fn is_if(&self) -> bool
Returns true if this is an AtNode::If variant.
Sourcepub fn is_for(&self) -> bool
pub fn is_for(&self) -> bool
Returns true if this is an AtNode::For variant.
Sourcepub fn is_match(&self) -> bool
pub fn is_match(&self) -> bool
Returns true if this is an AtNode::Match variant.
Sourcepub fn is_element(&self) -> bool
pub fn is_element(&self) -> bool
Returns true if this is an AtNode::Element variant.
Source§impl AtNode
impl AtNode
Sourcepub fn as_match(&self) -> &MatchNode
pub fn as_match(&self) -> &MatchNode
Returns the inner MatchNode. Panics if not a Match variant.
Sourcepub fn as_element(&self) -> &ElementNode
pub fn as_element(&self) -> &ElementNode
Returns the inner ElementNode. Panics if not an Element variant.
Trait Implementations§
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.
Auto Trait Implementations§
impl Freeze for AtNode
impl RefUnwindSafe for AtNode
impl !Send for AtNode
impl !Sync for AtNode
impl Unpin for AtNode
impl UnsafeUnpin for AtNode
impl UnwindSafe for AtNode
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