pub struct ElementWriter<'a, W> { /* private fields */ }
Expand description
A struct to write an element. Contains methods to add attributes and inner elements to the element
Implementations§
Source§impl<'a, W> ElementWriter<'a, W>
impl<'a, W> ElementWriter<'a, W>
Sourcepub fn with_attribute<'b, I>(self, attr: I) -> Self
pub fn with_attribute<'b, I>(self, attr: I) -> Self
Adds an attribute to this element.
Sourcepub fn with_attributes<'b, I>(self, attributes: I) -> Self
pub fn with_attributes<'b, I>(self, attributes: I) -> Self
Add additional attributes to this element using an iterator.
The yielded items must be convertible to Attribute
using Into
.
Source§impl<'a, W: Write> ElementWriter<'a, W>
impl<'a, W: Write> ElementWriter<'a, W>
Sourcepub fn write_text_content(
self,
text: BytesText<'_>,
) -> Result<&'a mut Writer<W>>
pub fn write_text_content( self, text: BytesText<'_>, ) -> Result<&'a mut Writer<W>>
Write some text inside the current element.
Sourcepub fn write_cdata_content(
self,
text: BytesCData<'_>,
) -> Result<&'a mut Writer<W>>
pub fn write_cdata_content( self, text: BytesCData<'_>, ) -> Result<&'a mut Writer<W>>
Write a CData event <![CDATA[...]]>
inside the current element.
Sourcepub fn write_pi_content(self, text: BytesText<'_>) -> Result<&'a mut Writer<W>>
pub fn write_pi_content(self, text: BytesText<'_>) -> Result<&'a mut Writer<W>>
Write a processing instruction <?...?>
inside the current element.
Sourcepub fn write_empty(self) -> Result<&'a mut Writer<W>>
pub fn write_empty(self) -> Result<&'a mut Writer<W>>
Write an empty (self-closing) tag.
Auto Trait Implementations§
impl<'a, W> Freeze for ElementWriter<'a, W>
impl<'a, W> RefUnwindSafe for ElementWriter<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for ElementWriter<'a, W>where
W: Send,
impl<'a, W> Sync for ElementWriter<'a, W>where
W: Sync,
impl<'a, W> Unpin for ElementWriter<'a, W>
impl<'a, W> !UnwindSafe for ElementWriter<'a, W>
Blanket Implementations§
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