pub enum TermRef<'a> {
BlankId(&'a BlankId),
Ground(GroundTermRef<'a>),
}Expand description
Term reference.
Variants§
Implementations§
Source§impl<'a> TermRef<'a>
impl<'a> TermRef<'a>
Sourcepub fn is_id(&self) -> bool
pub fn is_id(&self) -> bool
Checks if this term is an identifier, i.e. a blank node identifier or an IRI (as opposed to a literal).
Sourcepub fn as_id(&self) -> Option<IdRef<'a>>
pub fn as_id(&self) -> Option<IdRef<'a>>
Returns this term as an identifier, unless it is a literal.
Sourcepub fn into_id(self) -> Result<IdRef<'a>, LiteralRef<'a>>
pub fn into_id(self) -> Result<IdRef<'a>, LiteralRef<'a>>
Turns this term into an identifier, or returns the literal value if it isn’t one.
Sourcepub fn is_blank_id(&self) -> bool
pub fn is_blank_id(&self) -> bool
Checks if this is a blank node identifier.
Sourcepub fn is_ground(&self) -> bool
pub fn is_ground(&self) -> bool
Checks if this is a ground term (an IRI or a literal, but not a blank node identifier).
Sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Checks if this is a literal.
Sourcepub fn as_blank_id(&self) -> Option<&'a BlankId>
pub fn as_blank_id(&self) -> Option<&'a BlankId>
Returns this term as a blank node identifier, if it is one.
Sourcepub fn as_ground(&self) -> Option<GroundTermRef<'a>>
pub fn as_ground(&self) -> Option<GroundTermRef<'a>>
Returns this term as a ground term, if it is one.
Sourcepub fn as_literal(&self) -> Option<LiteralRef<'a>>
pub fn as_literal(&self) -> Option<LiteralRef<'a>>
Returns this term as a literal, if it is one.
Sourcepub fn into_ground(self) -> Result<GroundTermRef<'a>, &'a BlankId>
pub fn into_ground(self) -> Result<GroundTermRef<'a>, &'a BlankId>
Turns this term into a ground term, or returns the blank node identifier if it isn’t one.
Trait Implementations§
Source§impl Comparable<Term> for TermRef<'_>
impl Comparable<Term> for TermRef<'_>
impl<'a> Copy for TermRef<'a>
impl<'a> Eq for TermRef<'a>
Source§impl Equivalent<Term> for TermRef<'_>
impl Equivalent<Term> for TermRef<'_>
Source§fn equivalent(&self, key: &Term) -> bool
fn equivalent(&self, key: &Term) -> bool
Compare self to
key and return true if they are equal.Source§impl IntoOwned for TermRef<'_>
impl IntoOwned for TermRef<'_>
Source§type Owned = Term
type Owned = Term
The fully owned type produced by
into_owned.Source§fn into_owned(self) -> Term
fn into_owned(self) -> Term
Converts
self into a fully owned value, consuming it. Read moreSource§impl<'a> Ord for TermRef<'a>
impl<'a> Ord for TermRef<'a>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialEq for TermRef<'a>
impl<'a> PartialEq for TermRef<'a>
Source§impl PartialEq<CowTerm<'_>> for TermRef<'_>
impl PartialEq<CowTerm<'_>> for TermRef<'_>
Source§impl<'a> PartialEq<TermRef<'a>> for CowTerm<'_>
impl<'a> PartialEq<TermRef<'a>> for CowTerm<'_>
Source§impl<'a> PartialEq<TermRef<'a>> for Term
impl<'a> PartialEq<TermRef<'a>> for Term
Source§impl<'a> PartialOrd for TermRef<'a>
impl<'a> PartialOrd for TermRef<'a>
Source§impl PartialOrd<CowTerm<'_>> for TermRef<'_>
impl PartialOrd<CowTerm<'_>> for TermRef<'_>
Source§impl PartialOrd<Term> for TermRef<'_>
impl PartialOrd<Term> for TermRef<'_>
Source§impl<'a> PartialOrd<TermRef<'a>> for CowTerm<'_>
impl<'a> PartialOrd<TermRef<'a>> for CowTerm<'_>
Source§impl<'a> PartialOrd<TermRef<'a>> for Term
impl<'a> PartialOrd<TermRef<'a>> for Term
Source§impl RdfDisplay for TermRef<'_>
impl RdfDisplay for TermRef<'_>
Source§fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the value using the given formatter.
Source§fn rdf_display(&self) -> RdfDisplayed<&Self>
fn rdf_display(&self) -> RdfDisplayed<&Self>
Prepare the value to be formatted as an RDF syntax element.
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> UnsafeUnpin 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> Comparable<K> for Q
impl<Q, K> Comparable<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.