Skip to main content

Namespaces

Trait Namespaces 

Source
pub trait Namespaces: Sync {
    // Required methods
    fn ns_of(&self, element: u32) -> u32;
    fn uri(&self, id: u32) -> &str;

    // Provided methods
    fn declaration_count(&self, _node: u32) -> u32 { ... }
    fn declaration(&self, _node: u32, _i: u32) -> Option<(&str, u32)> { ... }
}
Expand description

The namespaces of an XML document built into a parsec-web tree, which the tree leaves to its host. Ids are the host’s; 0 is no namespace.

Required Methods§

Source

fn ns_of(&self, element: u32) -> u32

The namespace id of an element.

Source

fn uri(&self, id: u32) -> &str

The URI with id id; “” for 0.

Provided Methods§

Source

fn declaration_count(&self, _node: u32) -> u32

How many namespaces node declares (see Tree::namespace_declaration_count).

Source

fn declaration(&self, _node: u32, _i: u32) -> Option<(&str, u32)>

node’s ith declaration: its prefix (“” for the default namespace) and the id of its URI (0 for xmlns="").

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§