Struct xml::name::OwnedName [] [src]

pub struct OwnedName {
    pub local_name: String,
    pub namespace: Option<String>,
    pub prefix: Option<String>,
}

An owned variant of Name.

Everything about Name applies to this structure as well.

Fields

local_name

A local name, e.g. string in xsi:string.

namespace

A namespace URI, e.g. http://www.w3.org/2000/xmlns/.

prefix

A name prefix, e.g. xsi in xsi:string.

Methods

impl OwnedName

fn borrow(&self) -> Name

Constructs a borrowed Name based on this owned name.

fn local<'s, S: Into<Cow<'s, str>>>(local_name: S) -> OwnedName

Returns a new OwnedName instance representing a plain local name.

fn qualified<'s1, 's2, 's3, S1, S2, S3>(local_name: S1, namespace: S2, prefix: Option<S3>) -> OwnedName where S1: Into<Cow<'s1, str>>, S2: Into<Cow<'s2, str>>, S3: Into<Cow<'s3, str>>

Returns a new OwnedName instance representing a qualified name with or without a prefix and with a namespace URI.

fn prefix_as_ref(&self) -> Option<&str>

Returns an optional prefix by reference, equivalent to self.borrow().prefix but avoids extra work.

fn namespace_as_ref(&self) -> Option<&str>

Returns an optional namespace by reference, equivalen to self.borrow().namespace but avoids extra work.

fn to_repr(&self) -> String

See Name::to_repr() for details.

Trait Implementations

impl Display for OwnedName

fn fmt(&self, f: &mut Formatter) -> Result

impl FromStr for OwnedName

type Err = ()

fn from_str(s: &str) -> Result<OwnedName, ()>

Derived Implementations

impl Debug for OwnedName

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Hash for OwnedName

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl Eq for OwnedName

impl PartialEq for OwnedName

fn eq(&self, __arg_0: &OwnedName) -> bool

fn ne(&self, __arg_0: &OwnedName) -> bool

impl Clone for OwnedName

fn clone(&self) -> OwnedName

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