#[repr(transparent)]pub struct CmpTerm<T>(pub T);
Expand description
A wrapper for any term type that ensures comparability
Tuple Fields§
§0: T
Trait Implementations§
Source§impl<T: Term> Ord for CmpTerm<T>
impl<T: Term> Ord for CmpTerm<T>
Source§impl<T1: Term, T2: Term> PartialOrd<T2> for CmpTerm<T1>
impl<T1: Term, T2: Term> PartialOrd<T2> for CmpTerm<T1>
Source§impl<T: Term> Term for CmpTerm<T>
impl<T: Term> Term for CmpTerm<T>
Source§type BorrowTerm<'x> = CmpTerm<<T as Term>::BorrowTerm<'x>>
where
T: 'x
type BorrowTerm<'x> = CmpTerm<<T as Term>::BorrowTerm<'x>> where T: 'x
A type of
Term
that can be borrowed from this type
(i.e. that can be obtained from a simple reference to this type).
It is used in particular for accessing constituents of quoted tripes (Term::triple
)
or for sharing this term with a function that expects T: Term
(rather than &T
)
using Term::borrow_term
. Read moreSource§fn is_blank_node(&self) -> bool
fn is_blank_node(&self) -> bool
Source§fn is_literal(&self) -> bool
fn is_literal(&self) -> bool
Source§fn is_variable(&self) -> bool
fn is_variable(&self) -> bool
Source§fn bnode_id(&self) -> Option<BnodeId<MownStr<'_>>>
fn bnode_id(&self) -> Option<BnodeId<MownStr<'_>>>
If
kind
returns TermKind::BlankNode
,
return the locally unique label of this blank node.
Otherwise return None
. Read moreSource§fn lexical_form(&self) -> Option<MownStr<'_>>
fn lexical_form(&self) -> Option<MownStr<'_>>
If
kind
returns TermKind::Literal
,
return the lexical form of this literal.
Otherwise return None
. Read moreSource§fn datatype(&self) -> Option<IriRef<MownStr<'_>>>
fn datatype(&self) -> Option<IriRef<MownStr<'_>>>
If
kind
returns TermKind::Literal
,
return the datatype IRI of this literal.
Otherwise return None
. Read moreSource§fn language_tag(&self) -> Option<LanguageTag<MownStr<'_>>>
fn language_tag(&self) -> Option<LanguageTag<MownStr<'_>>>
If
kind
returns TermKind::Literal
,
and if this literal is a language-tagged string,
return its language tag.
Otherwise return None
. Read moreSource§fn variable(&self) -> Option<VarName<MownStr<'_>>>
fn variable(&self) -> Option<VarName<MownStr<'_>>>
If
kind
returns TermKind::Variable
,
return the name of this variable.
Otherwise return None
. Read moreSource§fn to_triple(self) -> Option<[Self; 3]>
fn to_triple(self) -> Option<[Self; 3]>
If
kind
returns TermKind::Triple
,
return this triple, consuming this term.
Otherwise return None
. Read moreSource§fn borrow_term(&self) -> Self::BorrowTerm<'_>
fn borrow_term(&self) -> Self::BorrowTerm<'_>
Source§fn eq<U: Term>(&self, other: U) -> bool
fn eq<U: Term>(&self, other: U) -> bool
Check whether
self
and other
represent the same RDF term.Source§fn hash<H: Hasher>(&self, state: &mut H)
fn hash<H: Hasher>(&self, state: &mut H)
Compute an implementation-independant hash of this RDF term.
Source§fn try_into_term<U: TryFromTerm>(self) -> Result<U, U::Error>
fn try_into_term<U: TryFromTerm>(self) -> Result<U, U::Error>
Try to convert this term into another type. Read more
Source§fn constituents<'s>(
&'s self,
) -> Box<dyn Iterator<Item = Self::BorrowTerm<'s>> + 's>
fn constituents<'s>( &'s self, ) -> Box<dyn Iterator<Item = Self::BorrowTerm<'s>> + 's>
Iter over all the constituents of this term. Read more
Source§fn to_constituents<'a>(self) -> Box<dyn Iterator<Item = Self> + 'a>where
Self: Clone + 'a,
fn to_constituents<'a>(self) -> Box<dyn Iterator<Item = Self> + 'a>where
Self: Clone + 'a,
Iter over all the constiutents of this term, consuming it. Read more
Source§fn as_simple(&self) -> SimpleTerm<'_>
fn as_simple(&self) -> SimpleTerm<'_>
Copies this term into a
SimpleTerm
,
borrowing as much as possible from self
(calling SimpleTerm::from_term_ref
).Source§impl<T: Term + TryFromTerm> TryFromTerm for CmpTerm<T>
impl<T: Term + TryFromTerm> TryFromTerm for CmpTerm<T>
impl<T: Copy> Copy for CmpTerm<T>
impl<T: Term> Eq for CmpTerm<T>
Auto Trait Implementations§
impl<T> Freeze for CmpTerm<T>where
T: Freeze,
impl<T> RefUnwindSafe for CmpTerm<T>where
T: RefUnwindSafe,
impl<T> Send for CmpTerm<T>where
T: Send,
impl<T> Sync for CmpTerm<T>where
T: Sync,
impl<T> Unpin for CmpTerm<T>where
T: Unpin,
impl<T> UnwindSafe for CmpTerm<T>where
T: UnwindSafe,
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