pub struct MyTerm<'a> {
pub value: Cow<'a, str>,
pub ty: Option<TermKind>,
pub span: Range<usize>,
pub context: TermContext<'a>,
}Fields§
§value: Cow<'a, str>§ty: Option<TermKind>§span: Range<usize>§context: TermContext<'a>Implementations§
Source§impl<'a> MyTerm<'a>
impl<'a> MyTerm<'a>
pub fn to_owned(&self) -> MyTerm<'static>
pub fn variable<T: Into<Cow<'a, str>>>(value: T, span: Range<usize>) -> Self
pub fn named_node<T: Into<Cow<'a, str>>>(value: T, span: Range<usize>) -> Self
pub fn blank_node<T: Into<Cow<'a, str>>>(value: T, span: Range<usize>) -> Self
pub fn literal<T: Into<Cow<'a, str>>>( value: T, span: Range<usize>, context: TermContext<'a>, ) -> Self
pub fn invalid(span: Range<usize>) -> Self
pub fn as_str(&'a self) -> &'a str
Trait Implementations§
Source§impl From<ConcreteLiteral> for MyTerm<'static>
impl From<ConcreteLiteral> for MyTerm<'static>
Source§fn from(value: ConcreteLiteral) -> Self
fn from(value: ConcreteLiteral) -> Self
Converts to this type from the input type.
Source§impl From<IriOrBlankNode> for MyTerm<'static>
impl From<IriOrBlankNode> for MyTerm<'static>
Source§fn from(value: IriOrBlankNode) -> Self
fn from(value: IriOrBlankNode) -> Self
Converts to this type from the input type.
Source§impl From<MyTerm<'static>> for ConcreteLiteral
impl From<MyTerm<'static>> for ConcreteLiteral
Source§impl Literal for MyTerm<'static>
impl Literal for MyTerm<'static>
Source§fn lexical_form(&self) -> &str
fn lexical_form(&self) -> &str
Returns the lexical form of the literal as a string slice.
Source§fn to_concrete_literal(&self) -> Option<ConcreteLiteral>
fn to_concrete_literal(&self) -> Option<ConcreteLiteral>
Converts this literal to an
ConcreteLiteral if possible.Source§fn to_bool(&self) -> Option<bool>
fn to_bool(&self) -> Option<bool>
Attempts to convert this literal to a boolean value. Read more
Source§fn to_integer(&self) -> Option<isize>
fn to_integer(&self) -> Option<isize>
Attempts to convert this literal to an integer value. Read more
Source§fn to_date_time(&self) -> Option<XsdDateTime>
fn to_date_time(&self) -> Option<XsdDateTime>
Attempts to convert this literal to a datetime value. Read more
Source§impl<'a> Ord for MyTerm<'a>
impl<'a> Ord for MyTerm<'a>
Source§impl<'a> PartialOrd for MyTerm<'a>
impl<'a> PartialOrd for MyTerm<'a>
Source§impl Subject for MyTerm<'_>
impl Subject for MyTerm<'_>
Source§fn is_blank_node(&self) -> bool
fn is_blank_node(&self) -> bool
Returns
true if this subject is a blank node.Source§impl<'a> Term for MyTerm<'a>
impl<'a> Term for MyTerm<'a>
Source§type BorrowTerm<'x> = &'x MyTerm<'a>
where
Self: 'x
type BorrowTerm<'x> = &'x MyTerm<'a> where Self: '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 borrow_term(&self) -> Self::BorrowTerm<'_>
fn borrow_term(&self) -> Self::BorrowTerm<'_>
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]>where
Self: Sized,
fn to_triple(self) -> Option<[Self; 3]>where
Self: Sized,
If
kind returns TermKind::Triple,
return this triple, consuming this term.
Otherwise return None. 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 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 constituents of this term, consuming it. Read more
Source§fn eq<T>(&self, other: T) -> boolwhere
T: Term,
fn eq<T>(&self, other: T) -> boolwhere
T: Term,
Check whether
self and other represent the same RDF term.Source§fn hash<H>(&self, state: &mut H)where
H: Hasher,
fn hash<H>(&self, state: &mut H)where
H: Hasher,
Compute an implementation-independent hash of this RDF term.
Source§fn try_into_term<T>(self) -> Result<T, <T as TryFromTerm>::Error>where
T: TryFromTerm,
Self: Sized,
fn try_into_term<T>(self) -> Result<T, <T as TryFromTerm>::Error>where
T: TryFromTerm,
Self: Sized,
Try to convert this term into another type. 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 Term for MyTerm<'static>
impl Term for MyTerm<'static>
Source§fn lexical_form(&self) -> String
fn lexical_form(&self) -> String
Returns the lexical representation of this term as a string.
Source§fn is_blank_node(&self) -> bool
fn is_blank_node(&self) -> bool
Returns
true if this term is a blank node.Source§fn is_literal(&self) -> bool
fn is_literal(&self) -> bool
Returns
true if this term is a literal.Source§impl Triple<MyTerm<'static>, MyTerm<'static>, MyTerm<'static>> for MyQuad<'static>
impl Triple<MyTerm<'static>, MyTerm<'static>, MyTerm<'static>> for MyQuad<'static>
Source§fn new(
subject: impl Into<MyTerm<'static>>,
predicate: impl Into<MyTerm<'static>>,
object: impl Into<MyTerm<'static>>,
) -> Self
fn new( subject: impl Into<MyTerm<'static>>, predicate: impl Into<MyTerm<'static>>, object: impl Into<MyTerm<'static>>, ) -> Self
Constructs a new RDF triple from the given components. Read more
Source§fn into_components(self) -> (MyTerm<'static>, MyTerm<'static>, MyTerm<'static>)
fn into_components(self) -> (MyTerm<'static>, MyTerm<'static>, MyTerm<'static>)
Consumes the triple and returns its components as a tuple. Read more
Source§fn into_subject(self) -> S
fn into_subject(self) -> S
Consumes the triple and returns only the subject.
Source§fn into_predicate(self) -> P
fn into_predicate(self) -> P
Consumes the triple and returns only the predicate.
Source§fn into_object(self) -> O
fn into_object(self) -> O
Consumes the triple and returns only the object.
Source§impl TryFrom<MyTerm<'static>> for IriOrBlankNode
impl TryFrom<MyTerm<'static>> for IriOrBlankNode
impl<'a> Eq for MyTerm<'a>
Auto Trait Implementations§
impl<'a> Freeze for MyTerm<'a>
impl<'a> RefUnwindSafe for MyTerm<'a>
impl<'a> Send for MyTerm<'a>
impl<'a> Sync for MyTerm<'a>
impl<'a> Unpin for MyTerm<'a>
impl<'a> UnsafeUnpin for MyTerm<'a>
impl<'a> UnwindSafe for MyTerm<'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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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<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§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> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
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.
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of this value.