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:

This example is not tested
// 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:

This example is not tested
// 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:

This example is not tested
<furn:table>
   |    |
   |    +- local name
   |
 prefix (when resolved gives namespace_url)

Fields

Methods

impl QualName

Trait Implementations

impl Clone for QualName

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialOrd<QualName> for QualName

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for QualName

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Hash for QualName

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq<QualName> for QualName

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for QualName

Formats the value using the given formatter. Read more

impl Eq for QualName

impl QualNameExt for QualName
[src]

[src]

Is this name effectively local?

[src]

Is this qualified name this local-only name (no prefix, no namespace)

[src]

Is this qualified name on these local-only names (no prefix, no namespace)

[src]

Can this element have children?

[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

[src]

Can this element's descendant text nodes have leading, trailing and interstitial whitespace collapsed?

impl QualNameOnlyExt for QualName
[src]

[src]

Produces local-only QualName

Auto Trait Implementations

impl Send for QualName

impl Sync for QualName