[−][src]Struct xml::writer::events::StartElementBuilder
A builder for a starting element event.
Methods
impl<'a> StartElementBuilder<'a>
[src]
pub fn attr<N>(self, name: N, value: &'a str) -> StartElementBuilder<'a> where
N: Into<Name<'a>>,
[src]
N: Into<Name<'a>>,
Sets an attribute value of this element to the given string.
This method can be used to add attributes to the starting element. Name is a qualified name; its namespace is ignored, but its prefix is checked for correctness, that is, it is checked that the prefix is bound to some namespace in the current context.
Currently attributes are not checked for duplicates. Note that duplicate attributes are a violation of XML document well-formedness.
The writer checks that you don't specify reserved prefix names, for example xmlns
.
pub fn ns<S1, S2>(self, prefix: S1, uri: S2) -> StartElementBuilder<'a> where
S1: Into<String>,
S2: Into<String>,
[src]
S1: Into<String>,
S2: Into<String>,
Adds a namespace to the current namespace context.
If no namespace URI was bound to the provided prefix at this point of the document, then the mapping from the prefix to the provided namespace URI will be written as a part of this element attribute set.
If the same namespace URI was bound to the provided prefix at this point of the document, then no namespace attributes will be emitted.
If some other namespace URI was bound to the provided prefix at this point of the document, then another binding will be added as a part of this element attribute set, shadowing the outer binding.
pub fn default_ns<S>(self, uri: S) -> StartElementBuilder<'a> where
S: Into<String>,
[src]
S: Into<String>,
Adds a default namespace mapping to the current namespace context.
Same rules as for ns()
are also valid for the default namespace mapping.
Trait Implementations
impl<'a> From<StartElementBuilder<'a>> for XmlEvent<'a>
[src]
fn from(b: StartElementBuilder<'a>) -> XmlEvent<'a>
[src]
Auto Trait Implementations
impl<'a> Send for StartElementBuilder<'a>
impl<'a> Unpin for StartElementBuilder<'a>
impl<'a> Sync for StartElementBuilder<'a>
impl<'a> UnwindSafe for StartElementBuilder<'a>
impl<'a> RefUnwindSafe for StartElementBuilder<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,