Struct rdf_types::Quad

source ·
pub struct Quad<S = Term, P = S, O = S, G = S>(pub S, pub P, pub O, pub Option<G>);
Expand description

RDF quad.

Tuple Fields§

§0: S§1: P§2: O§3: Option<G>

Implementations§

source§

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

source

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

source§

impl<S, P, O, G> Quad<S, P, O, G>

source

pub fn borrow_components(&self) -> Quad<&S, &P, &O, &G>

👎Deprecated since 0.18.4: please use as_ref instead
source

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

Borrows each component of the quad.

source§

impl<'s, 'p, 'o, 'g, S, P, O, G> Quad<&'s S, &'p P, &'o O, &'g G>

source

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

source

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

source§

impl<'s, 'p, 'o, 'g, S, P, O, G> Quad<&'s S, &'p P, &'o O, &'g G>

source

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

source

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

source§

impl Quad<Id, IriBuf, Term>

source§

impl<'a> Quad<Id<&'a Iri, &'a BlankId>, &'a Iri, Term<Id<&'a Iri, &'a BlankId>, &'a Literal>>

source§

impl<S, P, O, G> Quad<S, P, O, G>

source

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

Creates a new quad.

source

pub fn subject(&self) -> &S

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

source

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

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

source

pub fn into_subject(self) -> S

Turns the quad into its subject, the first component.

source

pub fn predicate(&self) -> &P

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

source

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

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

source

pub fn into_predicate(self) -> P

Turns the quad into its predicate, the second component.

source

pub fn object(&self) -> &O

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

source

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

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

source

pub fn into_object(self) -> O

Turns the quad into its object, the third component.

source

pub fn graph(&self) -> Option<&G>

Returns a reference to the graph of the quad, the fourth component.

source

pub fn graph_mut(&mut self) -> Option<&mut G>

Returns a mutable reference to the graph of the quad, the fourth component.

source

pub fn into_graph(self) -> Option<G>

Turns the quad into its graph, the fourth component.

source

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

source

pub fn into_triple(self) -> (Triple<S, P, O>, Option<G>)

Turns this quad into a triple and its graph component.

source

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

Maps the subject with the given function.

source

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

Maps the subject with the given function.

source

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

Maps the subject with the given function.

source

pub fn map_graph<U>( self, f: impl FnOnce(Option<G>) -> Option<U> ) -> Quad<S, P, O, U>

Maps the graph with the given function.

source

pub fn map_all<S2, P2, O2, G2>( self, s: impl FnOnce(S) -> S2, p: impl FnOnce(P) -> P2, o: impl FnOnce(O) -> O2, g: impl FnOnce(Option<G>) -> Option<G2> ) -> Quad<S2, P2, O2, G2>

Maps every quad component with the given functions, one for each component.

source§

impl<T> Quad<T, T, T, T>

source

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

Maps the components with the given function.

Trait Implementations§

source§

impl<S: Clone, P: Clone, O: Clone, G: Clone> Clone for Quad<S, P, O, G>

source§

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

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, G: Debug> Debug for Quad<S, P, O, G>

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, G: RdfDisplay> Display for Quad<S, P, O, G>

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>, G: EmbedIntoVocabulary<V>> EmbedIntoVocabulary<V> for Quad<S, P, O, G>

§

type Embedded = Quad<<S as EmbedIntoVocabulary<V>>::Embedded, <P as EmbedIntoVocabulary<V>>::Embedded, <O as EmbedIntoVocabulary<V>>::Embedded, <G 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>, G: EmbeddedIntoVocabulary<V>> EmbeddedIntoVocabulary<V> for Quad<S, P, O, G>

source§

impl<R: Clone + Ord> Extend<Quad<R>> for BTreeDataset<R>

source§

fn extend<T: IntoIterator<Item = Quad<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<Quad<R>> for IndexedBTreeDataset<R>

source§

fn extend<T: IntoIterator<Item = Quad<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>, G: ExtractFromVocabulary<V>> ExtractFromVocabulary<V> for Quad<S, P, O, G>

source§

impl<V, S: ExtractedFromVocabulary<V>, P: ExtractedFromVocabulary<V>, O: ExtractedFromVocabulary<V>, G: ExtractedFromVocabulary<V>> ExtractedFromVocabulary<V> for Quad<S, P, O, G>

§

type Extracted = Quad<<S as ExtractedFromVocabulary<V>>::Extracted, <P as ExtractedFromVocabulary<V>>::Extracted, <O as ExtractedFromVocabulary<V>>::Extracted, <G 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<Quad<Option<T>>> for CanonicalQuadPattern<T>

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

impl<T> From<Quad<T>> for CanonicalQuadPattern<T>

source§

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

Converts to this type from the input type.
source§

impl<R: Clone + Ord> FromIterator<Quad<R>> for BTreeDataset<R>

source§

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

Creates a value from an iterator. Read more
source§

impl<R: Clone + Ord> FromIterator<Quad<R>> for IndexedBTreeDataset<R>

source§

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

Creates a value from an iterator. Read more
source§

impl<S: Hash, P: Hash, O: Hash, G: Hash> Hash for Quad<S, P, O, G>

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: Interpret<I>, P: Interpret<I>, O: Interpret<I>, G: Interpret<I>, I: Interpretation> Interpret<I> for Quad<S, P, O, G>

§

type Interpreted = Quad<<S as Interpret<I>>::Interpreted, <P as Interpret<I>>::Interpreted, <O as Interpret<I>>::Interpreted, <G as Interpret<I>>::Interpreted>

Interpreted form.
source§

fn interpret(self, interpretation: &mut I) -> Self::Interpreted

Interpret the given resource.
source§

impl<S: Ord, P: Ord, O: Ord, G: Ord> Ord for Quad<S, P, O, G>

source§

fn cmp(&self, other: &Quad<S, P, O, G>) -> 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 + PartialOrd,

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

impl<S1: PartialEq<S2>, P1: PartialEq<P2>, O1: PartialEq<O2>, G1: PartialEq<G2>, S2, P2, O2, G2> PartialEq<Quad<S2, P2, O2, G2>> for Quad<S1, P1, O1, G1>

source§

fn eq(&self, other: &Quad<S2, P2, O2, G2>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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>, G1: PartialOrd<G2>, S2, P2, O2, G2> PartialOrd<Quad<S2, P2, O2, G2>> for Quad<S1, P1, O1, G1>

source§

fn partial_cmp(&self, other: &Quad<S2, P2, O2, G2>) -> 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

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

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

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

This method 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, G: RdfDisplay> RdfDisplay for Quad<S, P, O, G>

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<V, S: TryExtractFromVocabulary<V>, P: TryExtractFromVocabulary<V>, O: TryExtractFromVocabulary<V>, G: TryExtractFromVocabulary<V>> TryExtractFromVocabulary<V> for Quad<S, P, O, G>

source§

impl<S: Copy, P: Copy, O: Copy, G: Copy> Copy for Quad<S, P, O, G>

source§

impl<S: Eq, P: Eq, O: Eq, G: Eq> Eq for Quad<S, P, O, G>

Auto Trait Implementations§

§

impl<S, P, O, G> Freeze for Quad<S, P, O, G>
where G: Freeze, O: Freeze, P: Freeze, S: Freeze,

§

impl<S, P, O, G> RefUnwindSafe for Quad<S, P, O, G>

§

impl<S, P, O, G> Send for Quad<S, P, O, G>
where G: Send, O: Send, P: Send, S: Send,

§

impl<S, P, O, G> Sync for Quad<S, P, O, G>
where G: Sync, O: Sync, P: Sync, S: Sync,

§

impl<S, P, O, G> Unpin for Quad<S, P, O, G>
where G: Unpin, O: Unpin, P: Unpin, S: Unpin,

§

impl<S, P, O, G> UnwindSafe for Quad<S, P, O, G>

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

§

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§

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

§

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

§

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.