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;
    fn id_of(&self, uri: &str) -> Option<u32>;
}
Expand description

The namespaces of an XML document built into a parsec-html 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.

Source

fn id_of(&self, uri: &str) -> Option<u32>

The id of uri in this document, None if nothing in it has that namespace. “” is 0.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§