Struct rdf::namespace::Namespace
[−]
[src]
pub struct Namespace { /* fields omitted */ }
Representation of a specific namespace.
Methods
impl Namespace
[src]
pub fn new(prefix: String, uri: Uri) -> Namespace
[src]
Namespace
constructor.
Examples
use rdf::namespace::Namespace; use rdf::uri::Uri; let ns = Namespace::new("example".to_string(), Uri::new("http://example.org/".to_string()));
pub fn prefix(&self) -> &String
[src]
Returns the prefix of the namespace.
Examples
use rdf::namespace::Namespace; use rdf::uri::Uri; let ns = Namespace::new("example".to_string(), Uri::new("http://example.org/".to_string())); assert_eq!(ns.prefix(), "example");
pub fn uri(&self) -> &Uri
[src]
Returns the URI of the namespace.
Examples
use rdf::namespace::Namespace; use rdf::uri::Uri; let ns = Namespace::new("example".to_string(), Uri::new("http://example.org/".to_string())); assert_eq!(ns.uri(), &Uri::new("http://example.org/".to_string()));