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

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

Namespace is a map from prefixes to namespace URIs.

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

Methods

impl Namespace
[src]

[src]

Returns an empty namespace.

[src]

Checks whether this namespace is empty.

[src]

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

[src]

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.

[src]

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.

[src]

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.

[src]

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

impl PartialEq for Namespace
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for Namespace
[src]

impl Clone for Namespace
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Namespace
[src]

[src]

Formats the value using the given formatter.

impl<'a> IntoIterator for &'a Namespace
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<'a> Extend<UriMapping<'a>> for Namespace
[src]

[src]

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