[][src]Struct roxmltree::Namespace

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

A namespace.

Contains URI and prefix pair.

Methods

impl<'input> Namespace<'input>[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<'input> Clone for Namespace<'input>[src]

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

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

impl<'input> StructuralPartialEq for Namespace<'input>[src]

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

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.