Struct xml::namespace::NamespaceStack [−][src]
Expand description
Namespace stack is a sequence of namespaces.
Namespace stack is used to represent cumulative namespace consisting of combined namespaces from nested elements.
Tuple Fields
0: Vec<Namespace>
Implementations
Returns an empty namespace stack.
Returns a namespace stack with default items in it.
Default items are the following:
xml
→http://www.w3.org/XML/1998/namespace
;xmlns
→http://www.w3.org/2000/xmlns/
.
Adds an empty namespace to the top of this stack.
Removes the topmost namespace in this stack.
Panics if the stack is empty.
Removes the topmost namespace in this stack.
Returns Some(namespace)
if this stack is not empty and None
otherwise.
Borrows the topmost namespace mutably, leaving the stack intact.
Panics if the stack is empty.
Borrows the topmost namespace immutably, leaving the stack intact.
Panics if the stack is empty.
Puts a mapping into the topmost namespace if this stack does not already contain one.
Returns a boolean flag indicating whether the insertion has completed successfully. Note that both key and value are matched and the mapping is inserted if either namespace prefix is not already mapped, or if it is mapped, but to a different URI.
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 stack.
Puts a mapping into the topmost namespace in this stack.
This method does not override a mapping in the topmost namespace if it is already present, however, it does not depend on other namespaces in the stack, so it is possible to put a mapping which is present in lower namespaces.
Returns a boolean flag indicating whether the insertion has completed successfully.
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.
Performs a search for the given prefix in the whole stack.
This method walks the stack from top to bottom, querying each namespace
in order for the given prefix. If none of the namespaces contains the prefix,
None
is returned.
Parameters
prefix
— namespace prefix.
Combines this stack of namespaces into a single namespace.
Namespaces are combined in left-to-right order, that is, rightmost namespace elements take priority over leftmost ones.
Returns an object which implements Extend
using put_checked()
instead of put()
.
See CheckedTarget
for more information.
pub fn iter(&self) -> NamespaceStackMappings<'_>ⓘNotable traits for NamespaceStackMappings<'a>impl<'a> Iterator for NamespaceStackMappings<'a> type Item = UriMapping<'a>;
pub fn iter(&self) -> NamespaceStackMappings<'_>ⓘNotable traits for NamespaceStackMappings<'a>impl<'a> Iterator for NamespaceStackMappings<'a> type Item = UriMapping<'a>;
impl<'a> Iterator for NamespaceStackMappings<'a> type Item = UriMapping<'a>;
Returns an iterator over all mappings in this namespace stack.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
type Item = UriMapping<'a>
type Item = UriMapping<'a>
The type of the elements being iterated over.
type IntoIter = NamespaceStackMappings<'a>
type IntoIter = NamespaceStackMappings<'a>
Which kind of iterator are we turning this into?
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for NamespaceStack
impl Send for NamespaceStack
impl Sync for NamespaceStack
impl Unpin for NamespaceStack
impl UnwindSafe for NamespaceStack
Blanket Implementations
Mutably borrows from an owned value. Read more