pub struct BasicTermMap { /* private fields */ }Implementations§
Source§impl BasicTermMap
impl BasicTermMap
pub fn new() -> BasicTermMap
Trait Implementations§
Source§impl Clone for BasicTermMap
impl Clone for BasicTermMap
Source§fn clone(&self) -> BasicTermMap
fn clone(&self) -> BasicTermMap
Returns a copy 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 BasicTermMap
impl Debug for BasicTermMap
Source§impl Default for BasicTermMap
impl Default for BasicTermMap
Source§fn default() -> BasicTermMap
fn default() -> BasicTermMap
Returns the “default value” for a type. Read more
Source§impl TermMap for BasicTermMap
impl TermMap for BasicTermMap
Source§fn resolve_unchecked(&self, label: &str) -> Option<Arc<Term>>
fn resolve_unchecked(&self, label: &str) -> Option<Arc<Term>>
§Example
use taganak_core::environment::profile::{BasicTermMap, TermMap};
use taganak_core::terms::Term;
use std::sync::Arc;
let mut tm = BasicTermMap::default();
tm.set_default("https://example.com/foo/".to_string());
tm.set("something".to_string(), Arc::new("<https://example.com/bar/something>".try_into().unwrap())).unwrap();
assert_eq!(tm.resolve_unchecked("something").unwrap().to_string(), "<https://example.com/bar/something>");
assert_eq!(tm.resolve_unchecked("else").unwrap().to_string(), "<https://example.com/foo/else>");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::{BasicTermMap, TermMap};
use taganak_core::terms::Term;
use std::sync::Arc;
let mut tm = BasicTermMap::default();
tm.set("something".to_string(), Arc::new("<https://example.com/bar/something>".try_into().unwrap())).unwrap();
assert_eq!(tm.shrink(Arc::new("<https://example.com/bar/something>".try_into().unwrap())).unwrap(), "something");
assert_eq!(tm.shrink(Arc::new("<https://example.com/bar/else>".try_into().unwrap())).unwrap(), "https://example.com/bar/else");fn set_unchecked(&mut self, label: String, term: Arc<Term>)
fn set_default(&mut self, term: String)
fn remove(&mut self, label: &str)
fn validate_label(label: &str) -> Result<(), ProfileError>
fn set(&mut self, label: String, term: Arc<Term>) -> Result<(), ProfileError>
fn resolve(&self, label: &str) -> Result<Arc<Term>, ProfileError>
Auto Trait Implementations§
impl Freeze for BasicTermMap
impl RefUnwindSafe for BasicTermMap
impl Send for BasicTermMap
impl Sync for BasicTermMap
impl Unpin for BasicTermMap
impl UnwindSafe for BasicTermMap
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