Skip to main content

MyTerm

Struct MyTerm 

Source
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>

Source

pub fn to_owned(&self) -> MyTerm<'static>

Source

pub fn variable<T: Into<Cow<'a, str>>>(value: T, span: Range<usize>) -> Self

Source

pub fn named_node<T: Into<Cow<'a, str>>>(value: T, span: Range<usize>) -> Self

Source

pub fn blank_node<T: Into<Cow<'a, str>>>(value: T, span: Range<usize>) -> Self

Source

pub fn literal<T: Into<Cow<'a, str>>>( value: T, span: Range<usize>, context: TermContext<'a>, ) -> Self

Source

pub fn invalid(span: Range<usize>) -> Self

Source

pub fn as_str(&'a self) -> &'a str

Trait Implementations§

Source§

impl BlankNode for MyTerm<'static>

Source§

fn new(id: impl Into<String>) -> Self

Constructs a new blank node with the given identifier. Read more
Source§

fn id(&self) -> &str

Returns the identifier of this blank node as a string slice.
Source§

impl<'a> Borrow<str> for &MyTerm<'a>

Source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
Source§

impl<'a> Clone for MyTerm<'a>

Source§

fn clone(&self) -> MyTerm<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for MyTerm<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Display for MyTerm<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<ConcreteLiteral> for MyTerm<'static>

Source§

fn from(value: ConcreteLiteral) -> Self

Converts to this type from the input type.
Source§

impl From<IriOrBlankNode> for MyTerm<'static>

Source§

fn from(value: IriOrBlankNode) -> Self

Converts to this type from the input type.
Source§

impl From<IriS> for MyTerm<'static>

Source§

fn from(value: IriS) -> Self

Converts to this type from the input type.
Source§

impl From<MyQuad<'static>> for MyTerm<'static>

Source§

fn from(value: MyQuad<'static>) -> Self

Converts to this type from the input type.
Source§

impl From<MyTerm<'static>> for ConcreteLiteral

Source§

fn from(t: MyTerm<'static>) -> Self

Converts to this type from the input type.
Source§

impl From<MyTerm<'static>> for IriS

Source§

fn from(value: MyTerm<'static>) -> Self

Converts to this type from the input type.
Source§

impl From<MyTerm<'static>> for Object

Source§

fn from(term: MyTerm<'static>) -> Self

Converts to this type from the input type.
Source§

impl From<Object> for MyTerm<'static>

Source§

fn from(value: Object) -> Self

Converts to this type from the input type.
Source§

impl From<String> for MyTerm<'static>

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for MyTerm<'static>

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for MyTerm<'static>

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for MyTerm<'static>

Source§

fn from(value: i128) -> Self

Converts to this type from the input type.
Source§

impl Hash for MyTerm<'_>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Iri for MyTerm<'static>

Source§

fn as_str(&self) -> &str

Returns the IRI as a string slice.
Source§

impl Literal for MyTerm<'static>

Source§

fn lexical_form(&self) -> &str

Returns the lexical form of the literal as a string slice.
Source§

fn lang(&self) -> Option<Lang>

Returns the language tag if this is a language-tagged literal.
Source§

fn datatype(&self) -> IriRef

Returns the datatype IRI of this literal.
Source§

fn to_concrete_literal(&self) -> Option<ConcreteLiteral>

Converts this literal to an ConcreteLiteral if possible.
Source§

fn to_bool(&self) -> Option<bool>

Attempts to convert this literal to a boolean value. Read more
Source§

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>

Attempts to convert this literal to a datetime value. Read more
Source§

fn to_double(&self) -> Option<f64>

Attempts to convert this literal to a double-precision float value. Read more
Source§

fn to_decimal(&self) -> Option<Decimal>

Attempts to convert this literal to a decimal value. Read more
Source§

impl Matcher<MyTerm<'static>> for MyTerm<'static>

Source§

fn value(&self) -> Option<&MyTerm<'static>>

Returns the underlying value if this matcher represents a specific value. Read more
Source§

impl<'a> Ord for MyTerm<'a>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for MyTerm<'_>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialOrd for MyTerm<'a>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Subject for MyTerm<'_>

Source§

fn kind(&self) -> TermKind

Returns the kind of RDF term this subject represents. Read more
Source§

fn is_iri(&self) -> bool

Returns true if this subject is an IRI.
Source§

fn is_blank_node(&self) -> bool

Returns true if this subject is a blank node.
Source§

fn is_triple(&self) -> bool

Returns true if this subject is a quoted triple (RDF-star).
Source§

impl<'a> Term for MyTerm<'a>

Source§

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 more
Source§

fn kind(&self) -> TermKind

Return the kind of RDF term that this Term represents.
Source§

fn borrow_term(&self) -> Self::BorrowTerm<'_>

Get something implementing Term from a simple reference to self, representing the same RDF term as self. Read more
Source§

fn iri(&self) -> Option<IriRef<MownStr<'_>>>

If kind returns TermKind::Iri, return this IRI. Otherwise return None. Read more
Source§

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 more
Source§

fn lexical_form(&self) -> Option<MownStr<'_>>

If kind returns TermKind::Literal, return the lexical form of this literal. Otherwise return None. Read more
Source§

fn datatype(&self) -> Option<IriRef<MownStr<'_>>>

If kind returns TermKind::Literal, return the datatype IRI of this literal. Otherwise return None. Read more
Source§

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 more
Source§

fn variable(&self) -> Option<VarName<MownStr<'_>>>

If kind returns TermKind::Variable, return the name of this variable. Otherwise return None. Read more
Source§

fn triple(&self) -> Option<[Self::BorrowTerm<'_>; 3]>

If kind returns TermKind::Triple, return this triple. Otherwise return None. Read more
Source§

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 more
Source§

fn is_iri(&self) -> bool

Return true if this Term is an IRI, i.e. if kind returns TermKind::Iri.
Source§

fn is_blank_node(&self) -> bool

Return true if this Term is a blank node, i.e. if kind returns TermKind::BlankNode.
Source§

fn is_literal(&self) -> bool

Return true if this Term is a literal, i.e. if kind returns TermKind::Literal.
Source§

fn is_variable(&self) -> bool

Return true if this Term is a variable, i.e. if kind returns TermKind::Variable.
Source§

fn is_atom(&self) -> bool

Return true if this Term is an atomic term, i.e. an IRI, a blank node, a literal or a variable.
Source§

fn is_triple(&self) -> bool

Return true if this Term is an RDF-star quoted triple, i.e. if kind returns TermKind::Triple.
Source§

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,

Iter over all the constituents of this term, consuming it. Read more
Source§

fn atoms<'s>(&'s self) -> Box<dyn Iterator<Item = Self::BorrowTerm<'s>> + 's>

Iter over all the atomic constituents of this term. Read more
Source§

fn to_atoms<'a>(self) -> Box<dyn Iterator<Item = Self> + 'a>
where Self: Sized + 'a,

Iter over all the atomic constituents of this term, consuming it. Read more
Source§

fn eq<T>(&self, other: T) -> bool
where T: Term,

Check whether self and other represent the same RDF term.
Source§

fn cmp<T>(&self, other: T) -> Ordering
where T: Term,

Compare two terms: Read more
Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Compute an implementation-independent hash of this RDF term.
Source§

fn into_term<T>(self) -> T
where T: FromTerm, Self: Sized,

Convert this term in another type. Read more
Source§

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<'_>

Copies this term into a SimpleTerm, borrowing as much as possible from self (calling SimpleTerm::from_term_ref).
Source§

impl Term for MyTerm<'static>

Source§

fn kind(&self) -> TermKind

Returns the kind of RDF term this represents. Read more
Source§

fn lexical_form(&self) -> String

Returns the lexical representation of this term as a string.
Source§

fn is_iri(&self) -> bool

Returns true if this term is an IRI.
Source§

fn is_blank_node(&self) -> bool

Returns true if this term is a blank node.
Source§

fn is_literal(&self) -> bool

Returns true if this term is a literal.
Source§

fn is_triple(&self) -> bool

Returns true if this term is a quoted triple (RDF-star).
Source§

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

Constructs a new RDF triple from the given components. Read more
Source§

fn subj(&self) -> &MyTerm<'static>

Returns a reference to the subject of this triple.
Source§

fn pred(&self) -> &MyTerm<'static>

Returns a reference to the predicate of this triple.
Source§

fn obj(&self) -> &MyTerm<'static>

Returns a reference to the object of this triple.
Source§

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

Consumes the triple and returns only the subject.
Source§

fn into_predicate(self) -> P

Consumes the triple and returns only the predicate.
Source§

fn into_object(self) -> O

Consumes the triple and returns only the object.
Source§

impl<'a, 'b> TryFrom<&'b MyTerm<'a>> for Term

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'b MyTerm<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<MyTerm<'static>> for IriOrBlankNode

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(term: MyTerm<'static>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'b> TryInto<Term> for MyTerm<'static>

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Term, Self::Error>

Performs the conversion.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynEq for T
where T: Any + Eq,

Source§

fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool

This method tests for self and other values to be equal. Read more
Source§

impl<T> DynHash for T
where T: DynEq + Hash,

Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Feeds this value into the given Hasher.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of this value.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ConditionalSend for T
where T: Send,