pub struct SimpleNamespaces { /* private fields */ }
Expand description

Simple namespace tracker.

 This is the default namespace tracker used by Encoder::new. At the cost of increased output size, it reduces memory footprint by only tracking unprefixed namespaces. Prefixed namespaces may be declared, but are forgotten about once the element start is over.

Effectively, when used with an Encoder, this means that prefixed namespaces will only ever be used for attributes, and may be re-declared a lot.

 One exception is that prefixed namespaces declared on the root element will actually be made available on all child elements.

Implementations§

Look up the namespace URI for a given prefix

 Note: This function is implemented as O(n) function because it should rarely, if ever, be necessary to use. Speeding up runtime of this function would increase memory cost at neglegible gain.

The namespace URIs for the xml and xmlns prefixes are always returned, even if not explicitly declared.

Trait Implementations§

Formats the value using the given formatter. Read more
Declare a namespace URI with a defined prefix. Read more
Declare a namespace URI with an auto-generated prefix or by using the default namespace. Read more
Declare a namespace URI with an auto-generated prefix. Read more
Get the prefix for a given URI, which may be empty if the namespace with that URI is defined as the default namespace.
Get the prefix for a given URI. Read more
Complete an element declaration.
Signal end of element to undeclare nested namespace declarations.
Return the newly declared default namespace, if any. Read more
Return an iterator over the the newly declared prefixes.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.