pub enum TermRef<'a> {
NamedNode(&'a str),
BlankNode(&'a str),
Literal(&'a str, Option<&'a str>, Option<&'a str>),
Variable(&'a str),
}
Expand description
Zero-copy RDF term reference that avoids allocations
This provides efficient operations on RDF terms without copying data
Variants§
NamedNode(&'a str)
BlankNode(&'a str)
Literal(&'a str, Option<&'a str>, Option<&'a str>)
Variable(&'a str)
Implementations§
Source§impl<'a> TermRef<'a>
impl<'a> TermRef<'a>
Sourcepub fn from_named_node(node: &'a NamedNode) -> Self
pub fn from_named_node(node: &'a NamedNode) -> Self
Create a term reference from a named node
Sourcepub fn from_blank_node(node: &'a BlankNode) -> Self
pub fn from_blank_node(node: &'a BlankNode) -> Self
Create a term reference from a blank node
Sourcepub fn from_literal(literal: &'a Literal) -> Self
pub fn from_literal(literal: &'a Literal) -> Self
Create a term reference from a literal
Sourcepub fn to_owned(&self) -> Result<Term, OxirsError>
pub fn to_owned(&self) -> Result<Term, OxirsError>
Convert to an owned Term (allocating if necessary)
Sourcepub fn is_named_node(&self) -> bool
pub fn is_named_node(&self) -> bool
Returns true if this is a named node
Sourcepub fn is_blank_node(&self) -> bool
pub fn is_blank_node(&self) -> bool
Returns true if this is a blank node
Sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Returns true if this is a literal
Sourcepub fn is_variable(&self) -> bool
pub fn is_variable(&self) -> bool
Returns true if this is a variable
Trait Implementations§
impl<'a> Copy for TermRef<'a>
impl<'a> Eq for TermRef<'a>
impl<'a> StructuralPartialEq for TermRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for TermRef<'a>
impl<'a> RefUnwindSafe for TermRef<'a>
impl<'a> Send for TermRef<'a>
impl<'a> Sync for TermRef<'a>
impl<'a> Unpin for TermRef<'a>
impl<'a> UnwindSafe for TermRef<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.