pub struct BasicPrefixMap(/* private fields */);Implementations§
Source§impl BasicPrefixMap
impl BasicPrefixMap
pub fn new() -> BasicPrefixMap
Trait Implementations§
Source§impl Clone for BasicPrefixMap
impl Clone for BasicPrefixMap
Source§fn clone(&self) -> BasicPrefixMap
fn clone(&self) -> BasicPrefixMap
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BasicPrefixMap
impl Debug for BasicPrefixMap
Source§impl Default for BasicPrefixMap
impl Default for BasicPrefixMap
Source§fn default() -> BasicPrefixMap
fn default() -> BasicPrefixMap
Returns the “default value” for a type. Read more
Source§impl PrefixMap for BasicPrefixMap
impl PrefixMap for BasicPrefixMap
Source§fn resolve(&self, curie: &str) -> Result<Arc<Term>, ProfileError>
fn resolve(&self, curie: &str) -> Result<Arc<Term>, ProfileError>
§Example
use taganak_core::environment::profile::{BasicPrefixMap, PrefixMap};
let pm = BasicPrefixMap::default();
let i1 = pm.resolve("rdf:type").unwrap();
let i2 = pm.resolve("xml:lang").unwrap();
assert_eq!(i1.to_string(), "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>");
assert_eq!(i2.to_string(), "<http://www.w3.org/XML/1998/namespace/lang>");Source§fn shrink(&self, term: Arc<Term>) -> Result<String, ProfileError>
fn shrink(&self, term: Arc<Term>) -> Result<String, ProfileError>
§Example
use taganak_core::environment::profile::{BasicPrefixMap, PrefixMap};
use std::sync::Arc;
let pm = BasicPrefixMap::default();
let c1 = pm.shrink(Arc::new("<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>".try_into().unwrap())).unwrap();
let c2 = pm.shrink(Arc::new("<http://www.w3.org/XML/1998/namespace/lang>".try_into().unwrap())).unwrap();
assert_eq!(c1, "rdf:type");
assert_eq!(c2, "xml:lang");fn set(&mut self, prefix: String, iri: String) -> Result<(), ProfileError>
fn remove(&mut self, prefix: &str)
fn iter(&self) -> impl Iterator<Item = (&String, &String)> + Send
fn validate_prefix(prefix: &str) -> Result<(), ProfileError>
fn set_default(&mut self, iri: String) -> Result<(), ProfileError>
Auto Trait Implementations§
impl Freeze for BasicPrefixMap
impl RefUnwindSafe for BasicPrefixMap
impl Send for BasicPrefixMap
impl Sync for BasicPrefixMap
impl Unpin for BasicPrefixMap
impl UnwindSafe for BasicPrefixMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more