[−][src]Struct roxmltree::Attribute
An attribute.
Methods
impl<'input> Attribute<'input>
[src]
pub fn namespace(&self) -> Option<&str>
[src]
Returns attribute's namespace URI.
Examples
let doc = roxmltree::Document::parse( "<e xmlns:n='http://www.w3.org' a='b' n:a='c'/>" ).unwrap(); assert_eq!(doc.root_element().attributes()[0].namespace(), None); assert_eq!(doc.root_element().attributes()[1].namespace(), Some("http://www.w3.org"));
pub fn name(&self) -> &str
[src]
Returns attribute's name.
Examples
let doc = roxmltree::Document::parse( "<e xmlns:n='http://www.w3.org' a='b' n:a='c'/>" ).unwrap(); assert_eq!(doc.root_element().attributes()[0].name(), "a"); assert_eq!(doc.root_element().attributes()[1].name(), "a");
pub fn value(&self) -> &str
[src]
Returns attribute's value.
Examples
let doc = roxmltree::Document::parse( "<e xmlns:n='http://www.w3.org' a='b' n:a='c'/>" ).unwrap(); assert_eq!(doc.root_element().attributes()[0].value(), "b"); assert_eq!(doc.root_element().attributes()[1].value(), "c");
pub fn range(&self) -> Range<usize>
[src]
Returns attribute's name range in bytes in the original document.
You can calculate a human-readable text position via Document::text_pos_at.
<e attr='value'/>
^
pub fn value_range(&self) -> Range<usize>
[src]
Returns attribute's value range in bytes in the original document.
You can calculate a human-readable text position via Document::text_pos_at.
<e attr='value'/>
^
Trait Implementations
impl<'input> Clone for Attribute<'input>
[src]
impl<'input> Debug for Attribute<'input>
[src]
impl<'input> PartialEq<Attribute<'input>> for Attribute<'input>
[src]
Auto Trait Implementations
impl<'input> !RefUnwindSafe for Attribute<'input>
impl<'input> !Send for Attribute<'input>
impl<'input> !Sync for Attribute<'input>
impl<'input> Unpin for Attribute<'input>
impl<'input> UnwindSafe for Attribute<'input>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,