Struct Triple

Source
pub struct Triple<S = Term, P = S, O = S>(pub S, pub P, pub O);
Expand description

RDF triple.

Tuple Fields§

§0: S§1: P§2: O

Implementations§

Source§

impl<I, B, L> Triple<Id<I, B>, I, Term<Id<I, B>, L>>

Source

pub fn into_grdf(self) -> GrdfTriple<Id<I, B>, L>

Source§

impl<S, P, O> Triple<S, P, O>

Source

pub fn new(subject: S, predicate: P, object: O) -> Self

Creates a new triple.

Source

pub fn subject(&self) -> &S

Returns a reference to the subject of the triple, the first component.

Source

pub fn subject_mut(&mut self) -> &mut S

Returns a mutable reference to the subject of the triple, the first component.

Source

pub fn into_subject(self) -> S

Turns the triple into its subject, the first component.

Source

pub fn predicate(&self) -> &P

Returns a reference to the predicate of the triple, the second component.

Source

pub fn predicate_mut(&mut self) -> &mut P

Returns a mutable reference to the predicate of the triple, the second component.

Source

pub fn into_predicate(self) -> P

Turns the triple into its predicate, the second component.

Source

pub fn object(&self) -> &O

Returns a reference to the object of the triple, the third component.

Source

pub fn object_mut(&mut self) -> &mut O

Returns a mutable reference to the object of the triple, the third component.

Source

pub fn into_object(self) -> O

Turns the triple into its object, the third component.

Source

pub fn into_parts(self) -> (S, P, O)

Turns the triple into a tuple

Source

pub fn into_quad<G>(self, graph: Option<G>) -> Quad<S, P, O, G>

Turns the triple into a quad with the given graph component.

Source

pub fn map_subject<U>(self, f: impl FnOnce(S) -> U) -> Triple<U, P, O>

Maps the subject with the given function.

Source

pub fn map_predicate<U>(self, f: impl FnOnce(P) -> U) -> Triple<S, U, O>

Maps the subject with the given function.

Source

pub fn map_object<U>(self, f: impl FnOnce(O) -> U) -> Triple<S, P, U>

Maps the subject with the given function.

Source

pub fn as_ref(&self) -> Triple<&S, &P, &O>

Borrows each component of the triple.

Source§

impl<S, P, O> Triple<&S, &P, &O>

Source

pub fn cloned(&self) -> Triple<S, P, O>
where S: Clone, P: Clone, O: Clone,

Source

pub fn into_cloned(self) -> Triple<S, P, O>
where S: Clone, P: Clone, O: Clone,

Source§

impl<S, P, O> Triple<&S, &P, &O>

Source

pub fn copied(&self) -> Triple<S, P, O>
where S: Copy, P: Copy, O: Copy,

Source

pub fn into_copied(self) -> Triple<S, P, O>
where S: Copy, P: Copy, O: Copy,

Source§

impl<T> Triple<T, T, T>

Source

pub fn map<U>(self, f: impl FnMut(T) -> U) -> Triple<U, U, U>

Maps the components with the given function.

Source§

impl Triple<Id, IriBuf, Term>

Source§

impl Triple<Id<&Iri, &BlankId>, &Iri, Term<Id<&Iri, &BlankId>, &Literal>>

Trait Implementations§

Source§

impl<S: Clone, P: Clone, O: Clone> Clone for Triple<S, P, O>

Source§

fn clone(&self) -> Triple<S, P, O>

Returns a copy 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<S: Debug, P: Debug, O: Debug> Debug for Triple<S, P, O>

Source§

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

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

impl<S: RdfDisplay, P: RdfDisplay, O: RdfDisplay> Display for Triple<S, P, O>

Source§

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

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

impl<V, S: EmbedIntoVocabulary<V>, P: EmbedIntoVocabulary<V>, O: EmbedIntoVocabulary<V>> EmbedIntoVocabulary<V> for Triple<S, P, O>

Source§

type Embedded = Triple<<S as EmbedIntoVocabulary<V>>::Embedded, <P as EmbedIntoVocabulary<V>>::Embedded, <O as EmbedIntoVocabulary<V>>::Embedded>

Type of the value once embedded into the vocabulary.
Source§

fn embed_into_vocabulary(self, vocabulary: &mut V) -> Self::Embedded

Source§

impl<V, S: EmbeddedIntoVocabulary<V>, P: EmbeddedIntoVocabulary<V>, O: EmbeddedIntoVocabulary<V>> EmbeddedIntoVocabulary<V> for Triple<S, P, O>

Source§

impl<R: Clone + Ord> Extend<Triple<R>> for BTreeGraph<R>

Source§

fn extend<T: IntoIterator<Item = Triple<R>>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<R: Clone + Ord> Extend<Triple<R>> for IndexedBTreeGraph<R>

Source§

fn extend<T: IntoIterator<Item = Triple<R>>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<V, S: ExtractFromVocabulary<V>, P: ExtractFromVocabulary<V>, O: ExtractFromVocabulary<V>> ExtractFromVocabulary<V> for Triple<S, P, O>

Source§

impl<V, S: ExtractedFromVocabulary<V>, P: ExtractedFromVocabulary<V>, O: ExtractedFromVocabulary<V>> ExtractedFromVocabulary<V> for Triple<S, P, O>

Source§

type Extracted = Triple<<S as ExtractedFromVocabulary<V>>::Extracted, <P as ExtractedFromVocabulary<V>>::Extracted, <O as ExtractedFromVocabulary<V>>::Extracted>

Source§

fn extracted_from_vocabulary(&self, vocabulary: &V) -> Self::Extracted

Exports a value embedded into the vocabulary V. Read more
Source§

impl<T> From<Triple<Option<T>>> for CanonicalQuadPattern<T>

Source§

fn from(value: Triple<Option<T>>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Triple<Option<T>>> for CanonicalTriplePattern<T>

Source§

fn from(value: Triple<Option<T>, Option<T>, Option<T>>) -> Self

Converts to this type from the input type.
Source§

impl<T, X: PartialEq> From<Triple<ResourceOrVar<T, X>>> for CanonicalQuadPattern<T>

Source§

fn from(value: TriplePattern<T, X>) -> Self

Converts to this type from the input type.
Source§

impl<T, X: PartialEq> From<Triple<ResourceOrVar<T, X>>> for CanonicalTriplePattern<T>

Source§

fn from(value: TriplePattern<T, X>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Triple<T>> for CanonicalQuadPattern<T>

Source§

fn from(value: Triple<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Triple<T>> for CanonicalTriplePattern<T>

Source§

fn from(value: Triple<T>) -> Self

Converts to this type from the input type.
Source§

impl<R: Clone + Ord> FromIterator<Triple<R>> for BTreeGraph<R>

Source§

fn from_iter<T: IntoIterator<Item = Triple<R>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<R: Clone + Ord> FromIterator<Triple<R>> for IndexedBTreeGraph<R>

Source§

fn from_iter<T: IntoIterator<Item = Triple<R>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<S: Hash, P: Hash, O: Hash> Hash for Triple<S, P, O>

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<S: Ord, P: Ord, O: Ord> Ord for Triple<S, P, O>

Source§

fn cmp(&self, other: &Triple<S, P, O>) -> 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<S1: PartialEq<S2>, P1: PartialEq<P2>, O1: PartialEq<O2>, S2, P2, O2> PartialEq<Triple<S2, P2, O2>> for Triple<S1, P1, O1>

Source§

fn eq(&self, other: &Triple<S2, P2, O2>) -> 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<S1: PartialOrd<S2>, P1: PartialOrd<P2>, O1: PartialOrd<O2>, S2, P2, O2> PartialOrd<Triple<S2, P2, O2>> for Triple<S1, P1, O1>

Source§

fn partial_cmp(&self, other: &Triple<S2, P2, O2>) -> 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<S: RdfDisplay, P: RdfDisplay, O: RdfDisplay> RdfDisplay for Triple<S, P, O>

Source§

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

Formats the value using the given formatter.
Source§

fn rdf_display(&self) -> RdfDisplayed<&Self>

Prepare the value to be formatted as an RDF syntax element.
Source§

impl<S: Copy, P: Copy, O: Copy> Copy for Triple<S, P, O>

Source§

impl<S: Eq, P: Eq, O: Eq> Eq for Triple<S, P, O>

Auto Trait Implementations§

§

impl<S, P, O> Freeze for Triple<S, P, O>
where S: Freeze, P: Freeze, O: Freeze,

§

impl<S, P, O> RefUnwindSafe for Triple<S, P, O>

§

impl<S, P, O> Send for Triple<S, P, O>
where S: Send, P: Send, O: Send,

§

impl<S, P, O> Sync for Triple<S, P, O>
where S: Sync, P: Sync, O: Sync,

§

impl<S, P, O> Unpin for Triple<S, P, O>
where S: Unpin, P: Unpin, O: Unpin,

§

impl<S, P, O> UnwindSafe for Triple<S, P, O>
where S: UnwindSafe, P: UnwindSafe, O: UnwindSafe,

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

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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, 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.