Struct tagger::ElementStack [−][src]
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]
F: FnOnce(&'x mut AttributeWriter<'y, T>) -> Result<(&'x mut AttributeWriter<'y, T>, J), Error>,
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]
&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>,
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]
F: FnOnce(&'x mut AttributeWriter<'y, T>) -> Result<(&'x mut AttributeWriter<'y, T>, J), Error>,
Shorthand for Element::single_ext
with tag_types::NORMAL
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]
&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>,
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]
F: FnOnce(ElementHeaderWriter<'_, T>) -> Result<(&mut Element<T>, J), Error>,
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.
fn deref(&self) -> &Self::Target
[src]
impl<'a, T> DerefMut for ElementStack<'a, T>
[src]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for ElementStack<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for ElementStack<'a, T> where
T: Send,
T: Send,
impl<'a, T> Sync for ElementStack<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for ElementStack<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> UnwindSafe for ElementStack<'a, T> where
T: UnwindSafe,
T: UnwindSafe,
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, 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>,