[][src]Struct roxmltree::Namespace

pub struct Namespace<'d> { /* fields omitted */ }

A namespace.

Contains URI and prefix pair.

Methods

impl<'d> Namespace<'d>[src]

pub fn name(&self) -> Option<&str>[src]

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);

pub fn uri(&self) -> &str[src]

Returns namespace URI.

Examples

let doc = roxmltree::Document::parse(
    "<e xmlns:n='http://www.w3.org'/>"
).unwrap();

assert_eq!(doc.root_element().namespaces()[0].uri(), "http://www.w3.org");

Trait Implementations

impl<'d> PartialEq<Namespace<'d>> for Namespace<'d>[src]

impl<'d> Clone for Namespace<'d>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'d> Debug for Namespace<'d>[src]

Auto Trait Implementations

impl<'d> !Send for Namespace<'d>

impl<'d> !Sync for Namespace<'d>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.