Enum rdf_store_rs::Term
source · pub enum Term {
Iri(Literal),
Literal(Literal),
BlankNode(Literal),
}
Expand description
An RDF Term is either an IRI, a literal or a blank node.
Variants§
Implementations§
source§impl Term
impl Term
pub fn new_iri(iri: &Iri<'_>) -> Result<Self, RDFStoreError>
pub fn new_iri_from_str(iri_str: &str) -> Result<Self, RDFStoreError>
pub fn new_str(str: &str) -> Result<Self, RDFStoreError>
pub fn new_blank_node(str: &str) -> Result<Self, RDFStoreError>
sourcepub fn display_turtle<'a, 'b>(&'a self) -> impl Display + 'a + 'bwhere
'a: 'b,
pub fn display_turtle<'a, 'b>(&'a self) -> impl Display + 'a + 'bwhere
'a: 'b,
Display a Term
in human readable format.
use {iref::Iri, rdf_store_rs::Term};
let term = Term::new_iri(&Iri::new("https://whatever.url").unwrap()).unwrap();
let turtle = format!("{}", term.display_turtle());
assert_eq!(turtle, "<https://whatever.url>");
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnwindSafe for Term
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