Enum ludtwig_parser::ast::TwigStructure[][src]

pub enum TwigStructure<C> {
    TwigBlock(TwigBlock<C>),
    TwigFor(TwigFor<C>),
    TwigIf(TwigIf<C>),
    TwigApply(TwigApply<C>),
    TwigSetCapture(TwigSetCapture<C>),
}

Variants

TwigBlock(TwigBlock<C>)

Twig block structure which has a name and contains other SyntaxNode values as children. For example {% block my_block_name %}...{% endblock %}

TwigFor(TwigFor<C>)

Twig for block.

Example

{% for user in users %}
     <li>{{ user.username|e }}</li>
{% endfor %}
TwigIf(TwigIf<C>)

Twig if block.

Example

{% if product.stock > 10 %}
   Available
{% elseif product.stock > 0 %}
   Only {{ product.stock }} left!
{% else %}
   Sold-out!
{% endif %}
TwigApply(TwigApply<C>)

Twig apply block.

Example

{% apply upper %}
    This text becomes uppercase
{% endapply %}
TwigSetCapture(TwigSetCapture<C>)

Twig set block with no '='. captures the children.

Example

{% set foo %}
    <div>
        hello world
    </div>
{% endset %}

Trait Implementations

impl<C: Clone> Clone for TwigStructure<C>[src]

impl<C: Debug> Debug for TwigStructure<C>[src]

impl Display for TwigStructure<TagAttribute>[src]

implement the display trait for TwigStructure to easily display the user tag attributes as context, so they can find the tag that is causing parsing issues.

impl<C: Eq> Eq for TwigStructure<C>[src]

impl<C: PartialEq> PartialEq<TwigStructure<C>> for TwigStructure<C>[src]

impl<C> StructuralEq for TwigStructure<C>[src]

impl<C> StructuralPartialEq for TwigStructure<C>[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for TwigStructure<C> where
    C: RefUnwindSafe
[src]

impl<C> Send for TwigStructure<C> where
    C: Send
[src]

impl<C> Sync for TwigStructure<C> where
    C: Sync
[src]

impl<C> Unpin for TwigStructure<C> where
    C: Unpin
[src]

impl<C> UnwindSafe for TwigStructure<C> where
    C: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.