[][src]Trait bracket::parser::ast::Element

pub trait Element<'source> {
    fn open(&self) -> &'source str;
fn close(&self) -> &'source str;
fn open_span(&self) -> &Range<usize>;
fn close_span(&self) -> &Option<Range<usize>>;
fn is_closed(&self) -> bool;
fn exit(&mut self, close: Range<usize>); fn span(&self) -> Range<usize> { ... } }

Trait for elements that expect to be closed.

Required methods

fn open(&self) -> &'source str

Get the string for the open tag.

fn close(&self) -> &'source str

Get the string for the close tag.

If no close span has been set which can happen if the element has no end tag this should return the empty string.

fn open_span(&self) -> &Range<usize>

Get the span for the open tag.

fn close_span(&self) -> &Option<Range<usize>>

Get the span for the close tag.

fn is_closed(&self) -> bool

Determine if this element has been closed.

fn exit(&mut self, close: Range<usize>)

Mark this element as correctly terminated.

Loading content...

Provided methods

fn span(&self) -> Range<usize>

The full byte range for this element; if the element is not closed only the open span is returned.

Loading content...

Implementors

impl<'source> Element<'source> for Block<'source>[src]

impl<'source> Element<'source> for Call<'source>[src]

Loading content...