Struct tagger::ElementStack[][src]

pub struct ElementStack<'a, T> { /* fields omitted */ }

Sometimes, having to deal with all the borrowing and closures is difficult. For these cases a traditional ElementStack can be used. This allows you to move around the stack between functions and classes easily. The downside is that you lose compile time assurance that every push matches every pop.

Implementations

impl<'a, T: Write> ElementStack<'a, T>[src]

pub fn check_unwound(&mut self)[src]

pub fn new(writer: T) -> ElementStack<'a, T>[src]

pub fn from_element(writer: Element<T>) -> ElementStack<'a, T>[src]

pub fn elem_stack<F, J>(&mut self, tag: &'a str, func: F) -> Result<J, Error> where
    F: FnOnce(&'x mut AttributeWriter<'y, T>) -> Result<(&'x mut AttributeWriter<'y, T>, J), Error>, 
[src]

Write a element that has an ending tag. The user is required to feed the element back into this function thus proving that they called ElementHeaderWriter::write.

pub fn as_element(&mut self) -> &mut Element<T>[src]

Use Deref/DerefMut is possible

pub fn pop(&mut self) -> Result<&mut ElementStack<'a, T>, Error>[src]

Methods from Deref<Target = Element<T>>

pub fn get_writer(&mut self) -> &mut T[src]

pub fn empty_ok(&mut self) -> Result<(&mut Element<T>, ()), Error>[src]

pub fn single_ext<F, J>(
    &mut self,
    tag: &str,
    tags: [&str; 2],
    func: F
) -> Result<J, Error> where
    F: FnOnce(&'x mut AttributeWriter<'y, T>) -> Result<(&'x mut AttributeWriter<'y, T>, J), Error>, 
[src]

Write a element that doesnt have an ending tag. i.e. it can only have attributes. Some common tag types are in tag_types.

pub fn single<F, J>(&mut self, tag: &str, func: F) -> Result<J, Error> where
    F: FnOnce(&'x mut AttributeWriter<'y, T>) -> Result<(&'x mut AttributeWriter<'y, T>, J), Error>, 
[src]

pub fn elem_no_attr<F, J>(
    &mut self,
    tag: &str,
    func: F
) -> Result<(&mut Self, J), Error> where
    F: FnOnce(&'x mut Element<T>) -> Result<(&'x mut Element<T>, J), Error>, 
[src]

Shorthand for Element::elem with the attribute builder functionality omitted.

pub fn elem<J, F>(&mut self, tag: &str, func: F) -> Result<J, Error> where
    F: FnOnce(ElementHeaderWriter<'_, T>) -> Result<(&mut Element<T>, J), Error>, 
[src]

Write a element that has an ending tag. The user is required to feed the element back into this function thus proving that they called ElementHeaderWriter::write.

Trait Implementations

impl<'a, T> Deref for ElementStack<'a, T>[src]

type Target = Element<T>

The resulting type after dereferencing.

impl<'a, T> DerefMut for ElementStack<'a, T>[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for ElementStack<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for ElementStack<'a, T> where
    T: Send

impl<'a, T> Sync for ElementStack<'a, T> where
    T: Sync

impl<'a, T> Unpin for ElementStack<'a, T> where
    T: Unpin

impl<'a, T> UnwindSafe for ElementStack<'a, T> where
    T: UnwindSafe

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> From<T> for T[src]

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

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.