pub struct ElementBuilder<'a, W: Write> { /* private fields */ }Expand description
A builder for constructing XML elements with attributes before writing.
Implementations§
Source§impl<'a, W: Write> ElementBuilder<'a, W>
impl<'a, W: Write> ElementBuilder<'a, W>
Sourcepub fn optional_attr(self, key: &str, value: Option<&str>) -> Self
pub fn optional_attr(self, key: &str, value: Option<&str>) -> Self
Adds an optional attribute to the element, only if value is Some.
Sourcepub fn write_empty(self) -> Result<()>
pub fn write_empty(self) -> Result<()>
Writes the element as a self-closing empty element (e.g., <vertex x="1" />).
Sourcepub fn write_start(self) -> Result<()>
pub fn write_start(self) -> Result<()>
Writes the element as an opening tag (e.g., <model xmlns="...">) with child content to follow.
Auto Trait Implementations§
impl<'a, W> Freeze for ElementBuilder<'a, W>
impl<'a, W> RefUnwindSafe for ElementBuilder<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for ElementBuilder<'a, W>where
W: Send,
impl<'a, W> Sync for ElementBuilder<'a, W>where
W: Sync,
impl<'a, W> Unpin for ElementBuilder<'a, W>
impl<'a, W> UnsafeUnpin for ElementBuilder<'a, W>
impl<'a, W> !UnwindSafe for ElementBuilder<'a, W>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more