Struct xml::namespace::Namespace[][src]

pub struct Namespace(pub BTreeMap<String, String>);
Expand description

Namespace is a map from prefixes to namespace URIs.

No prefix (i.e. default namespace) is designated by NS_NO_PREFIX constant.

Tuple Fields

0: BTreeMap<String, String>

Implementations

Returns an empty namespace.

Checks whether this namespace is empty.

Checks whether this namespace is essentially empty, that is, it does not contain anything but default mappings.

Checks whether this namespace mapping contains the given prefix.

Parameters
  • prefix — namespace prefix.
Return value

true if this namespace contains the given prefix, false otherwise.

Puts a mapping into this namespace.

This method does not override any already existing mappings.

Returns a boolean flag indicating whether the map already contained the given prefix.

Parameters
  • prefix — namespace prefix;
  • uri — namespace URI.
Return value

true if prefix has been inserted successfully; false if the prefix was already present in the namespace.

Puts a mapping into this namespace forcefully.

This method, unlike put(), does replace an already existing mapping.

Returns previous URI which was assigned to the given prefix, if it is present.

Parameters
  • prefix — namespace prefix;
  • uri — namespace URI.
Return value

Some(uri) with uri being a previous URI assigned to the prefix, or None if such prefix was not present in the namespace before.

Queries the namespace for the given prefix.

Parameters
  • prefix — namespace prefix.
Return value

Namespace URI corresponding to the given prefix, if it is present.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.