pub struct Namespace<'input> { /* private fields */ }
Expand description
A namespace.
Contains URI and prefix pair.
Implementations
sourceimpl<'input> Namespace<'input>
impl<'input> Namespace<'input>
sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Returns namespace name/prefix.
Examples
let doc = roxmltree::Document::parse(
"<e xmlns:n='http://www.w3.org'/>"
).unwrap();
assert_eq!(doc.root_element().namespaces()[0].name(), Some("n"));
let doc = roxmltree::Document::parse(
"<e xmlns='http://www.w3.org'/>"
).unwrap();
assert_eq!(doc.root_element().namespaces()[0].name(), None);
Trait Implementations
sourceimpl<'input> PartialEq<Namespace<'input>> for Namespace<'input>
impl<'input> PartialEq<Namespace<'input>> for Namespace<'input>
impl<'input> StructuralPartialEq for Namespace<'input>
Auto Trait Implementations
impl<'input> RefUnwindSafe for Namespace<'input>
impl<'input> Send for Namespace<'input>
impl<'input> Sync for Namespace<'input>
impl<'input> Unpin for Namespace<'input>
impl<'input> UnwindSafe for Namespace<'input>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more