Struct rdf::namespace::NamespaceStore [−][src]
pub struct NamespaceStore { /* fields omitted */ }
Storage for multiple namespaces.
Methods
impl NamespaceStore
[src]
impl NamespaceStore
pub fn new() -> NamespaceStore
[src]
pub fn new() -> NamespaceStore
Constructor for NamespaceStore
.
Examples
use rdf::namespace::NamespaceStore; let nss = NamespaceStore::new();
pub fn namespaces(&self) -> &HashMap<String, Uri>
[src]
pub fn namespaces(&self) -> &HashMap<String, Uri>
Returns the stored namespaces with prefixes.
pub fn add(&mut self, ns: &Namespace)
[src]
pub fn add(&mut self, ns: &Namespace)
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: &str) -> Result<&Uri>
[src]
pub fn get_uri_by_prefix(&self, prefix: &str) -> Result<&Uri>
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").unwrap(), &Uri::new("http://example.org/".to_string()))
Trait Implementations
impl PartialEq for NamespaceStore
[src]
impl PartialEq for NamespaceStore
fn eq(&self, other: &NamespaceStore) -> bool
[src]
fn eq(&self, other: &NamespaceStore) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &NamespaceStore) -> bool
[src]
fn ne(&self, other: &NamespaceStore) -> bool
This method tests for !=
.
impl Debug for NamespaceStore
[src]
impl Debug for NamespaceStore
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for NamespaceStore
[src]
impl Default for NamespaceStore
fn default() -> NamespaceStore
[src]
fn default() -> NamespaceStore
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for NamespaceStore
impl Send for NamespaceStore
impl Sync for NamespaceStore
impl Sync for NamespaceStore