pub enum Term<T = IriBuf, B = BlankIdBuf> {
Null,
Id(Id<T, B>),
Keyword(Keyword),
}
Expand description
Identifier, keyword or @null
.
Variants§
Implementations§
Source§impl<I, B> Term<I, B>
impl<I, B> Term<I, B>
Sourcepub fn into_iri(self) -> Result<I, Term<I, B>>
pub fn into_iri(self) -> Result<I, Term<I, B>>
Turns this term into an IRI if possible.
If it is not an IRI, returns the term itself.
Sourcepub fn is_keyword(&self) -> bool
pub fn is_keyword(&self) -> bool
Checks if this term is a keyword.
Sourcepub fn as_iri(&self) -> Option<&I>
pub fn as_iri(&self) -> Option<&I>
Returns a reference to the IRI representation of the term, if any.
pub fn map_id<U, C>(self, f: impl FnOnce(Id<I, B>) -> Id<U, C>) -> Term<U, C>
Trait Implementations§
Source§impl<T, B, N> AsRefWithContext<str, N> for Term<T, B>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B, N> AsRefWithContext<str, N> for Term<T, B>where
N: Vocabulary<Iri = T, BlankId = B>,
fn as_ref_with<'a>(&'a self, vocabulary: &'a N) -> &'a str
Source§impl<T, B, N> DisplayWithContext<N> for Term<T, B>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B, N> DisplayWithContext<N> for Term<T, B>where
N: Vocabulary<Iri = T, BlankId = B>,
impl<T, B> Eq for Term<T, B>
impl<T, B> StructuralPartialEq for Term<T, B>
Auto Trait Implementations§
impl<T, B> Freeze for Term<T, B>
impl<T, B> RefUnwindSafe for Term<T, B>where
B: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, B> Send for Term<T, B>
impl<T, B> Sync for Term<T, B>
impl<T, B> Unpin for Term<T, B>
impl<T, B> UnwindSafe for Term<T, B>where
B: UnwindSafe,
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
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
fn equivalent(&self, key: &K) -> bool
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, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
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.