[−][src]Struct bracket::parser::ast::Block
Block encapsulates an inner template.
These nodes are rendered indirectly via registered helpers that should call back in to the renderer.
When a block has the raw flag set it should only contain a
single Text
child node.
Implementations
impl<'source> Block<'source>
[src]
pub fn new(source: &'source str, open: Range<usize>, raw: bool) -> Self
[src]
Create a new block.
pub fn call(&self) -> &Call<'source>
[src]
Get the call for the block.
pub fn set_call(&mut self, call: Call<'source>)
[src]
Set the call for the block.
pub fn name(&self) -> Option<&'source str>
[src]
The name of this block extracted from the call target.
This will only be available if the call target is a path and the path is a simple identifier.
pub fn is_raw(&self) -> bool
[src]
Determine if this block has the raw flag.
pub fn add_condition(&mut self, condition: Condition<'source>)
[src]
Add a condition to this block.
pub fn conditions(&self) -> &Vec<Node<'source>>
[src]
Get the list of conditional blocks.
pub fn push(&mut self, node: Node<'source>)
[src]
Add a node to this block; if this block has conditionals then the node is added to the last conditional.
pub fn nodes(&self) -> &'source Vec<Node<'_>>
[src]
The collection of nodes for this block.
For raw blocks this should always be a single Text
node.
pub fn trim_close(&self) -> TrimHint
[src]
The trim hint for the close tag.
Trait Implementations
impl<'_> Debug for Block<'_>
[src]
impl<'_> Display for Block<'_>
[src]
impl<'source> Element<'source> for Block<'source>
[src]
fn open(&self) -> &'source str
[src]
fn close(&self) -> &'source str
[src]
fn open_span(&self) -> &Range<usize>
[src]
fn close_span(&self) -> &Option<Range<usize>>
[src]
fn is_closed(&self) -> bool
[src]
fn exit(&mut self, span: Range<usize>)
[src]
impl<'source> Eq for Block<'source>
[src]
impl<'source> PartialEq<Block<'source>> for Block<'source>
[src]
impl<'source> Slice<'source> for Block<'source>
[src]
impl<'source> StructuralEq for Block<'source>
[src]
impl<'source> StructuralPartialEq for Block<'source>
[src]
Auto Trait Implementations
impl<'source> RefUnwindSafe for Block<'source>
impl<'source> Send for Block<'source>
impl<'source> Sync for Block<'source>
impl<'source> Unpin for Block<'source>
impl<'source> UnwindSafe for Block<'source>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,