Struct html5ever_ext::QualName
[−]
pub struct QualName { pub prefix: Option<Atom<PrefixStaticSet>>, pub ns: Atom<NamespaceStaticSet>, pub local: Atom<LocalNameStaticSet>, }
A name with a namespace. Fully qualified name. Used to depict names of tags and attributes.
Used to differentiate between similar XML fragments. For example:
// HTML <table> <tr> <td>Apples</td> <td>Bananas</td> </tr> </table> // Furniture XML <table> <name>African Coffee Table</name> <width>80</width> <length>120</length> </table>
Without XML namespaces, we can't use those two fragments in the same document at the same time. However if we declare a namespace we could instead say:
// Furniture XML <furn:table> <furn:name>African Coffee Table</furn:name> <furn:width>80</furn:width> <furn:length>120</furn:length> </furn:table>
and bind it to a different name.
For this reason we parse names that contain a colon in the following way:
<furn:table> | | | +- local name | prefix (when resolved gives namespace_url)
Fields
prefix: Option<Atom<PrefixStaticSet>>
ns: Atom<NamespaceStaticSet>
local: Atom<LocalNameStaticSet>
Methods
impl QualName
pub fn new(
prefix: Option<Atom<PrefixStaticSet>>,
ns: Atom<NamespaceStaticSet>,
local: Atom<LocalNameStaticSet>
) -> QualName
prefix: Option<Atom<PrefixStaticSet>>,
ns: Atom<NamespaceStaticSet>,
local: Atom<LocalNameStaticSet>
) -> QualName
pub fn expanded(&self) -> ExpandedName
Trait Implementations
impl Clone for QualName
fn clone(&self) -> QualName
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 PartialOrd<QualName> for QualName
fn partial_cmp(&self, __arg_0: &QualName) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &QualName) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &QualName) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &QualName) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &QualName) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for QualName
fn cmp(&self, __arg_0: &QualName) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for QualName
fn hash<__H>(&self, __arg_0: &mut __H) where
__H: Hasher,
__H: Hasher,
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 PartialEq<QualName> for QualName
fn eq(&self, __arg_0: &QualName) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &QualName) -> bool
This method tests for !=
.
impl Debug for QualName
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Eq for QualName
impl QualNameExt for QualName
[src]
fn is_unprefixed_and_html_namespace_or_none(&self) -> bool
[src]
Is this name effectively local?
fn is_only_local(&self, local_name: &LocalName) -> bool
[src]
Is this qualified name this local-only name (no prefix, no namespace)
fn is_only_local_of(&self, local_names: &[LocalName]) -> bool
[src]
Is this qualified name on these local-only names (no prefix, no namespace)
fn can_have_children(&self) -> bool
[src]
Can this element have children?
fn text_content_should_be_escaped(&self) -> bool
[src]
Should an immediate child text node have <
, >
and &
characters escaped? In modern HTML 5, the only common nodes which don't need this are <script>
and <style>
. In this case, the immediate child text node's content should not contain, say, </script>
as this will cause a parse error. Read more
fn can_collapse_whitespace(&self) -> bool
[src]
Can this element's descendant text nodes have leading, trailing and interstitial whitespace collapsed?