Struct roxmltree::ExpandedName

source ·
pub struct ExpandedName<'a, 'b> { /* private fields */ }
Expand description

An expanded name.

Contains an namespace URI and name pair.

Implementations§

source§

impl<'a, 'b> ExpandedName<'a, 'b>

source

pub fn namespace(&self) -> Option<&'a str>

Returns a namespace URI.

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

assert_eq!(doc.root_element().tag_name().namespace(), Some("http://www.w3.org"));
source

pub fn name(&self) -> &'b str

Returns a local name.

§Examples
let doc = roxmltree::Document::parse("<e/>").unwrap();

assert_eq!(doc.root_element().tag_name().name(), "e");
source§

impl ExpandedName<'static, 'static>

source

pub const fn from_static(uri: &'static str, name: &'static str) -> Self

Create a new instance from static data.

§Example
use roxmltree::ExpandedName;
const DAV_HREF: ExpandedName =
    ExpandedName::from_static("urn:ietf:params:xml:ns:caldav:", "calendar-data");

Trait Implementations§

source§

impl<'a, 'b> Clone for ExpandedName<'a, 'b>

source§

fn clone(&self) -> ExpandedName<'a, 'b>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExpandedName<'_, '_>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'a, 'b> From<&'b str> for ExpandedName<'a, 'b>

source§

fn from(v: &'b str) -> Self

Converts to this type from the input type.
source§

impl<'a, 'b> From<(&'a str, &'b str)> for ExpandedName<'a, 'b>

source§

fn from(v: (&'a str, &'b str)) -> Self

Converts to this type from the input type.
source§

impl<'a, 'b> PartialEq for ExpandedName<'a, 'b>

source§

fn eq(&self, other: &ExpandedName<'a, 'b>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, 'b> Copy for ExpandedName<'a, 'b>

source§

impl<'a, 'b> Eq for ExpandedName<'a, 'b>

source§

impl<'a, 'b> StructuralPartialEq for ExpandedName<'a, 'b>

Auto Trait Implementations§

§

impl<'a, 'b> Freeze for ExpandedName<'a, 'b>

§

impl<'a, 'b> RefUnwindSafe for ExpandedName<'a, 'b>

§

impl<'a, 'b> Send for ExpandedName<'a, 'b>

§

impl<'a, 'b> Sync for ExpandedName<'a, 'b>

§

impl<'a, 'b> Unpin for ExpandedName<'a, 'b>

§

impl<'a, 'b> UnwindSafe for ExpandedName<'a, 'b>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.