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

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

Trait for elements that expect to be closed.

Required methods

pub fn open(&self) -> &'source str[src]

Get the string for the open tag.

pub fn close(&self) -> &'source str[src]

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.

pub fn open_span(&self) -> &Range<usize>[src]

Get the span for the open tag.

pub fn close_span(&self) -> &Option<Range<usize>>[src]

Get the span for the close tag.

pub fn is_closed(&self) -> bool[src]

Determine if this element has been closed.

pub fn exit(&mut self, close: Range<usize>)[src]

Mark this element as correctly terminated.

Loading content...

Provided methods

pub fn span(&self) -> Range<usize>[src]

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]

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

Loading content...