Struct grdf::Quad

source ·
pub struct Quad<S = Id, P = IriBuf, O = Term, G = Id>(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 ) -> Quad<Term<Id<I, B>, L>, Term<Id<I, B>, L>, Term<Id<I, B>, L>, Term<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>

source§

impl<L> Quad<Id, IriBuf, Term<Id, L>>

source

pub fn as_quad_ref( &self ) -> Quad<Id<&Iri, &BlankId>, &Iri, Term<Id<&Iri, &BlankId>, &L>, Id<&Iri, &BlankId>>

source§

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

source

pub fn into_owned(self) -> Quad<Id, IriBuf, Term<Id, L>>where L: Clone,

source§

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

source

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

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.

Trait Implementations§

source§

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

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

source§

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

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

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

source§

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

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

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

source§

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

source§

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

§

type Output = Quad<<S as ExportedFromVocabulary<V>>::Output, <P as ExportedFromVocabulary<V>>::Output, <O as ExportedFromVocabulary<V>>::Output, <G as ExportedFromVocabulary<V>>::Output>

source§

fn exported_from_vocabulary( &self, vocabulary: &V ) -> <Quad<S, P, O, G> as ExportedFromVocabulary<V>>::Output

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

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

source§

fn extend<I: IntoIterator<Item = Quad<S, P, O, G>>>(&mut self, iter: I)

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<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> Extend<Quad<S, P, O, G>> for HashDataset<S, P, O, G>

source§

fn extend<I: IntoIterator<Item = Quad<S, P, O, G>>>(&mut self, iter: I)

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

source§

fn from_iter<I: IntoIterator<Item = Quad<S, P, O, G>>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<S: Eq + Hash, P: Eq + Hash, O: Eq + Hash, G: Eq + Hash> FromIterator<Quad<S, P, O, G>> for HashDataset<S, P, O, G>

source§

fn from_iter<I: IntoIterator<Item = Quad<S, P, O, G>>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<S, P, O, G> Hash for Quad<S, P, O, G>where S: Hash, P: Hash, O: Hash, G: 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<V, S, P, O, G> InsertIntoVocabulary<V> for Quad<S, P, O, G>where S: InsertIntoVocabulary<V>, P: InsertIntoVocabulary<V>, O: InsertIntoVocabulary<V>, G: InsertIntoVocabulary<V>,

source§

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

source§

impl<S, P, O, G, I> Interpret<I> for Quad<S, P, O, G>where S: Interpret<I>, P: Interpret<I>, O: Interpret<I>, G: Interpret<I>, I: Interpretation,

§

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 ) -> <Quad<S, P, O, G> as Interpret<I>>::Interpreted

Interpret the given resource.
source§

impl<S, P, O, G, T, U> MapLiteral<T, U> for Quad<S, P, O, G>where S: MapLiteral<T, U>, P: MapLiteral<T, U>, O: MapLiteral<T, U>, G: MapLiteral<T, U>,

§

type Output = Quad<<S as MapLiteral<T, U>>::Output, <P as MapLiteral<T, U>>::Output, <O as MapLiteral<T, U>>::Output, <G as MapLiteral<T, U>>::Output>

source§

fn map_literal( self, f: impl FnMut(T) -> U ) -> <Quad<S, P, O, G> as MapLiteral<T, U>>::Output

Maps RDF literal values.
source§

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

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) -> Selfwhere Self: Sized,

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

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

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

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

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

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

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

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

source§

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

source§

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

source§

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

source§

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

Auto Trait Implementations§

§

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

§

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>where G: UnwindSafe, O: UnwindSafe, P: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere 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 Qwhere 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, U> Into<U> for Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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.