pub struct BasicProfile { /* private fields */ }Implementations§
Source§impl BasicProfile
impl BasicProfile
pub fn new() -> BasicProfile
Trait Implementations§
Source§impl Clone for BasicProfile
impl Clone for BasicProfile
Source§fn clone(&self) -> BasicProfile
fn clone(&self) -> BasicProfile
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 BasicProfile
impl Debug for BasicProfile
Source§impl Default for BasicProfile
impl Default for BasicProfile
Source§fn default() -> BasicProfile
fn default() -> BasicProfile
Returns the “default value” for a type. Read more
Source§impl Profile for BasicProfile
impl Profile for BasicProfile
Source§fn resolve(&self, toresolve: &str) -> Result<Arc<Term>, ProfileError>
fn resolve(&self, toresolve: &str) -> Result<Arc<Term>, ProfileError>
§Example
use taganak_core::environment::profile::{BasicProfile, Profile};
use std::sync::Arc;
let mut p = BasicProfile::default();
let i1 = p.resolve("rdf:type").unwrap();
let i2 = p.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>");
p.set_default_vocabulary("https://example.com/foo/".to_string());
p.set_term("something".to_string(), Arc::new("<https://example.com/bar/something>".try_into().unwrap())).unwrap();
assert_eq!(p.resolve("something").unwrap().to_string(), "<https://example.com/bar/something>");
assert_eq!(p.resolve("else").unwrap().to_string(), "<https://example.com/foo/else>");fn set_default_vocabulary(&mut self, term: String)
fn set_term( &mut self, label: String, term: Arc<Term>, ) -> Result<(), ProfileError>
fn set_default_prefix(&mut self, iri: String) -> Result<(), ProfileError>
fn set_prefix( &mut self, prefix: String, iri: String, ) -> Result<(), ProfileError>
fn iter_prefices(&self) -> impl Iterator<Item = (&String, &String)> + Send
fn base_iri(&self) -> Option<&IriBuf>
fn set_base_iri(&mut self, iri: Option<IriBuf>)
fn resolve_iri_ref(&self, toresolve: IriRefBuf) -> Result<IriBuf, ProfileError>
fn shrink(&self, term: Arc<Term>) -> Result<String, ProfileError>
Auto Trait Implementations§
impl Freeze for BasicProfile
impl RefUnwindSafe for BasicProfile
impl Send for BasicProfile
impl Sync for BasicProfile
impl Unpin for BasicProfile
impl UnsafeUnpin for BasicProfile
impl UnwindSafe for BasicProfile
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