[−][src]Struct nestxml::Element
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]
S: Into<String>,
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]
N: Into<String>,
V: Into<String>,
Adds an attribute to the element.
pub fn write<F>(self, f: F) -> Result<(), Error> where
F: FnOnce(&mut EventWriter<W>) -> Result<(), Error>,
[src]
F: FnOnce(&mut EventWriter<W>) -> Result<(), Error>,
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]
F: FnOnce(&mut EventWriter<W>) -> Result<T, E>,
E: From<Error>,
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,
W: Send,
impl<'a, W> Sync for Element<'a, W> where
W: Sync,
W: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,