pub struct Namespace<'d> { /* private fields */ }
Expand description
A namespace.
Contains URI and prefix pair.
Implementations
sourceimpl<'d> Namespace<'d>
impl<'d> Namespace<'d>
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<'d> PartialEq<Namespace<'d>> for Namespace<'d>
impl<'d> PartialEq<Namespace<'d>> for Namespace<'d>
impl<'d> StructuralPartialEq for Namespace<'d>
Auto Trait Implementations
impl<'d> RefUnwindSafe for Namespace<'d>
impl<'d> !Send for Namespace<'d>
impl<'d> !Sync for Namespace<'d>
impl<'d> Unpin for Namespace<'d>
impl<'d> UnwindSafe for Namespace<'d>
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