Struct rdf::namespace::NamespaceStore
[−]
[src]
pub struct NamespaceStore { /* fields omitted */ }
Storage for multiple namespaces.
Methods
impl NamespaceStore
[src]
pub fn new() -> NamespaceStore
[src]
Constructor for NamespaceStore
.
Examples
use rdf::namespace::NamespaceStore; let nss = NamespaceStore::new();
pub fn namespaces(&self) -> &HashMap<String, Uri>
[src]
Returns the stored namespaces with prefixes.
pub fn add(&mut self, ns: &Namespace)
[src]
Adds a new namespace.
Examples
use rdf::namespace::NamespaceStore; use rdf::namespace::Namespace; use rdf::uri::Uri; let mut nss = NamespaceStore::new(); let ns = Namespace::new("example".to_string(), Uri::new("http://example.org/".to_string())); nss.add(&ns);
pub fn get_uri_by_prefix(&self, prefix: String) -> Result<&Uri>
[src]
Returns the URI of a specific namespace.
Examples
use rdf::namespace::NamespaceStore; use rdf::namespace::Namespace; use rdf::uri::Uri; let mut nss = NamespaceStore::new(); let ns = Namespace::new("example".to_string(), Uri::new("http://example.org/".to_string())); nss.add(&ns); assert_eq!(nss.get_uri_by_prefix("example".to_string()).unwrap(), &Uri::new("http://example.org/".to_string()))
Trait Implementations
impl PartialEq for NamespaceStore
[src]
fn eq(&self, __arg_0: &NamespaceStore) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &NamespaceStore) -> bool
[src]
This method tests for !=
.