[][src]Struct nestxml::Element

pub struct Element<'a, W: 'a> { /* fields omitted */ }

XML element

Methods

impl<'a, W: Write + 'a> Element<'a, W>[src]

pub fn new<S>(out: &'a mut EventWriter<W>, name: S) -> Self where
    S: Into<String>, 
[src]

Returns a XML element with the given name that will be written to out.

pub fn attr<N, V>(self, name: N, value: V) -> Self where
    N: Into<String>,
    V: Into<String>, 
[src]

Adds an attribute to the element.

pub fn write<F>(self, f: F) -> Result<(), Error> where
    F: FnOnce(&mut EventWriter<W>) -> Result<(), Error>, 
[src]

Writes this element and invokes f to fill in its children.

pub fn write_res<F, T, E>(self, f: F) -> Result<T, E> where
    F: FnOnce(&mut EventWriter<W>) -> Result<T, E>,
    E: From<Error>, 
[src]

Writes this element and invokes f to fill in its children.

pub fn empty(self) -> Result<(), Error>[src]

Writes this element without children.

pub fn text(self, s: &str) -> Result<(), Error>[src]

Writes this element with the given text as its only child.

Auto Trait Implementations

impl<'a, W> Send for Element<'a, W> where
    W: Send

impl<'a, W> Sync for Element<'a, W> where
    W: Sync

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.