Triple

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) -> Triple<Term<Id<I, B>, L>>

Source§

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

Source

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

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>

Source

pub fn map<U>(self, f: impl FnMut(T) -> U) -> Triple<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>>

Source

pub fn into_owned(self) -> Triple<Id, IriBuf, Term>

Trait Implementations§

Source§

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

Source§

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

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

Source§

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

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

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

Source§

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

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

impl<S, P, O, V> DisplayWithContext<V> for Triple<S, P, O>

Available on crate feature contextual only.
Source§

fn fmt_with(&self, vocabulary: &V, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl<V, S, P, O> 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, ) -> <Triple<S, P, O> as EmbedIntoVocabulary<V>>::Embedded

Source§

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

Source§

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

Source§

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

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> Extend<Triple<R>> for IndexedBTreeGraph<R>
where R: Clone + Ord,

Source§

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

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, P, O> ExtractFromVocabulary<V> for Triple<S, P, O>

Source§

impl<V, S, P, O> 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, ) -> <Triple<S, P, O> as ExtractedFromVocabulary<V>>::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>>) -> CanonicalQuadPattern<T>

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>>) -> CanonicalTriplePattern<T>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: Triple<ResourceOrVar<T, X>>) -> CanonicalQuadPattern<T>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: Triple<ResourceOrVar<T, X>>) -> CanonicalTriplePattern<T>

Converts to this type from the input type.
Source§

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

Source§

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

Converts to this type from the input type.
Source§

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

Source§

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

Converts to this type from the input type.
Source§

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

Source§

fn from_iter<T>(iter: T) -> BTreeGraph<R>
where T: IntoIterator<Item = Triple<R>>,

Creates a value from an iterator. Read more
Source§

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

Source§

fn from_iter<T>(iter: T) -> IndexedBTreeGraph<R>
where T: IntoIterator<Item = Triple<R>>,

Creates a value from an iterator. Read more
Source§

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

Source§

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

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

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, P1, O1, S2, P2, O2> PartialEq<Triple<S2, P2, O2>> for Triple<S1, P1, O1>
where S1: PartialEq<S2>, P1: PartialEq<P2>, O1: PartialEq<O2>,

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, P1, O1, S2, P2, O2> PartialOrd<Triple<S2, P2, O2>> for Triple<S1, P1, O1>
where S1: PartialOrd<S2>, P1: PartialOrd<P2>, O1: PartialOrd<O2>,

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

Source§

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

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, P, O, V> RdfDisplayWithContext<V> for Triple<S, P, O>

Available on crate feature contextual only.
Source§

fn rdf_fmt_with( &self, vocabulary: &V, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

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

Source§

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

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> At for T

Source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. 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> BorrowStripped for T

Source§

fn stripped(&self) -> &Stripped<T>

Source§

impl<T> BorrowUnordered for T

Source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

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

Source§

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

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, C> FromWithContext<T, C> for T

Source§

fn from_with(value: T, _context: &C) -> T

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, U, C> IntoWithContext<U, C> for T
where U: FromWithContext<T, C>,

Source§

fn into_with(self, context: &C) -> U

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> ToOwned for T

Source§

type Owned = T

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, C> TryFromWithContext<U, C> for T
where U: IntoWithContext<T, C>,

Source§

type Error = Infallible

Source§

fn try_from_with( value: U, context: &C, ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

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, U, C> TryIntoWithContext<U, C> for T
where U: TryFromWithContext<T, C>,

Source§

type Error = <U as TryFromWithContext<T, C>>::Error

Source§

fn try_into_with( self, context: &C, ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

Source§

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

Source§

fn vzip(self) -> V

Source§

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

Source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

Source§

fn into_with<C>(self, context: C) -> Contextual<T, C>