pub struct ElementBuilder { /* private fields */ }
Expand description
A builder for Element
Implementations§
Source§impl ElementBuilder
impl ElementBuilder
Sourcepub fn new<S>(name: S) -> ElementBuilderwhere
S: ToString,
pub fn new<S>(name: S) -> ElementBuilderwhere
S: ToString,
Create a builder for an Element
with the tag name name
Sourcepub fn prefix<S>(&mut self, prefix: S) -> &mut ElementBuilderwhere
S: ToString,
pub fn prefix<S>(&mut self, prefix: S) -> &mut ElementBuilderwhere
S: ToString,
Set the element’s prefix to prefix
Sourcepub fn attr<K, V>(&mut self, key: K, value: V) -> &mut ElementBuilder
pub fn attr<K, V>(&mut self, key: K, value: V) -> &mut ElementBuilder
Set the element’s attribute key
to value
Sourcepub fn text<S>(&mut self, text: S) -> &mut ElementBuilderwhere
S: ToString,
pub fn text<S>(&mut self, text: S) -> &mut ElementBuilderwhere
S: ToString,
Set the element’s text to text
Sourcepub fn cdata<S>(&mut self, cdata: S) -> &mut ElementBuilderwhere
S: ToString,
pub fn cdata<S>(&mut self, cdata: S) -> &mut ElementBuilderwhere
S: ToString,
Set the element’s CDATA to cdata
Sourcepub fn children(
&mut self,
children: Vec<&mut ElementBuilder>,
) -> &mut ElementBuilder
pub fn children( &mut self, children: Vec<&mut ElementBuilder>, ) -> &mut ElementBuilder
Append children to this Element
Trait Implementations§
Source§impl Clone for ElementBuilder
impl Clone for ElementBuilder
Source§fn clone(&self) -> ElementBuilder
fn clone(&self) -> ElementBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ElementBuilder
impl Debug for ElementBuilder
Source§impl From<Element> for ElementBuilder
impl From<Element> for ElementBuilder
Source§fn from(element: Element) -> ElementBuilder
fn from(element: Element) -> ElementBuilder
Converts to this type from the input type.
Source§impl From<ElementBuilder> for Element
impl From<ElementBuilder> for Element
Source§fn from(value: ElementBuilder) -> Element
fn from(value: ElementBuilder) -> Element
Converts to this type from the input type.
Source§impl PartialEq for ElementBuilder
impl PartialEq for ElementBuilder
impl Eq for ElementBuilder
impl StructuralPartialEq for ElementBuilder
Auto Trait Implementations§
impl Freeze for ElementBuilder
impl RefUnwindSafe for ElementBuilder
impl Send for ElementBuilder
impl Sync for ElementBuilder
impl Unpin for ElementBuilder
impl UnwindSafe for ElementBuilder
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