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: String
A local name, e.g. string
in xsi:string
.
namespace: Option<String>
A namespace URI, e.g. http://www.w3.org/2000/xmlns/
.
prefix: Option<String>
A name prefix, e.g. xsi
in xsi:string
.
Methods
impl OwnedName
[src]
fn borrow(&self) -> Name
[src]
Constructs a borrowed Name
based on this owned name.
fn local<S>(local_name: S) -> OwnedName where
S: Into<String>,
[src]
S: Into<String>,
Returns a new OwnedName
instance representing a plain local name.
fn qualified<S1, S2, S3>(
local_name: S1,
namespace: S2,
prefix: Option<S3>
) -> OwnedName where
S1: Into<String>,
S2: Into<String>,
S3: Into<String>,
[src]
local_name: S1,
namespace: S2,
prefix: Option<S3>
) -> OwnedName where
S1: Into<String>,
S2: Into<String>,
S3: Into<String>,
Returns a new OwnedName
instance representing a qualified name with or without
a prefix and with a namespace URI.
fn prefix_ref(&self) -> Option<&str>
[src]
Returns an optional prefix by reference, equivalent to self.borrow().prefix
but avoids extra work.
fn namespace_ref(&self) -> Option<&str>
[src]
Returns an optional namespace by reference, equivalen to self.borrow().namespace
but avoids extra work.
Trait Implementations
impl Clone for OwnedName
[src]
fn clone(&self) -> OwnedName
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for OwnedName
[src]
fn eq(&self, __arg_0: &OwnedName) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &OwnedName) -> bool
[src]
This method tests for !=
.
impl Eq for OwnedName
[src]
impl Hash for OwnedName
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for OwnedName
[src]
impl Display for OwnedName
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a> From<Name<'a>> for OwnedName
[src]
impl FromStr for OwnedName
[src]
type Err = ()
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<OwnedName, ()>
[src]
Parses the given string slice into a qualified name.
This function, when finishes sucessfully, always return a qualified
name without a namespace (name.namespace == None
). It should be filled later
using proper NamespaceStack
.
It is supposed that all characters in the argument string are correct as defined by the XML specification. No additional checks except a check for emptiness are done.