pub struct Namespace<'input> { /* private fields */ }
Expand description
A namespace.
Contains URI and prefix pair.
Implementations§
source§impl<'input> Namespace<'input>
impl<'input> Namespace<'input>
sourcepub fn name(&self) -> Option<&'input str>
pub fn name(&self) -> Option<&'input 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().nth(0).unwrap().name(), Some("n"));
let doc = roxmltree::Document::parse(
"<e xmlns='http://www.w3.org'/>"
).unwrap();
assert_eq!(doc.root_element().namespaces().nth(0).unwrap().name(), None);
Trait Implementations§
impl<'input> Eq for Namespace<'input>
impl<'input> StructuralPartialEq for Namespace<'input>
Auto Trait Implementations§
impl<'input> Freeze for Namespace<'input>
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§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)