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<'a, L> Quad<Id<&'a Iri, &'a BlankId>, &'a Iri, Term<Id<&'a Iri, &'a BlankId>, &'a L>, Id<&'a Iri, &'a BlankId>>
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§impl<S, P, O, G> Quad<S, P, O, G>
impl<S, P, O, G> Quad<S, P, O, G>
sourcepub fn new(
subject: S,
predicate: P,
object: O,
graph: Option<G>
) -> Quad<S, P, O, G>
pub fn new( subject: S, predicate: P, object: O, graph: Option<G> ) -> Quad<S, P, O, G>
Creates a new quad.
sourcepub fn subject(&self) -> &S
pub fn subject(&self) -> &S
Returns a reference to the subject of the quad, the first component.
sourcepub fn subject_mut(&mut self) -> &mut S
pub fn subject_mut(&mut self) -> &mut S
Returns a mutable reference to the subject of the quad, the first component.
sourcepub fn into_subject(self) -> S
pub fn into_subject(self) -> S
Turns the quad into its subject, the first component.
sourcepub fn predicate(&self) -> &P
pub fn predicate(&self) -> &P
Returns a reference to the predicate of the quad, the second component.
sourcepub fn predicate_mut(&mut self) -> &mut P
pub fn predicate_mut(&mut self) -> &mut P
Returns a mutable reference to the predicate of the quad, the second component.
sourcepub fn into_predicate(self) -> P
pub fn into_predicate(self) -> P
Turns the quad into its predicate, the second component.
sourcepub fn object_mut(&mut self) -> &mut O
pub fn object_mut(&mut self) -> &mut O
Returns a mutable reference to the object of the quad, the third component.
sourcepub fn into_object(self) -> O
pub fn into_object(self) -> O
Turns the quad into its object, the third component.
sourcepub fn graph(&self) -> Option<&G>
pub fn graph(&self) -> Option<&G>
Returns a reference to the graph of the quad, the fourth component.
sourcepub fn graph_mut(&mut self) -> Option<&mut G>
pub fn graph_mut(&mut self) -> Option<&mut G>
Returns a mutable reference to the graph of the quad, the fourth component.
sourcepub fn into_graph(self) -> Option<G>
pub fn into_graph(self) -> Option<G>
Turns the quad into its graph, the fourth component.
pub fn into_parts(self) -> (S, P, O, Option<G>)
sourcepub fn into_triple(self) -> (Triple<S, P, O>, Option<G>)
pub fn into_triple(self) -> (Triple<S, P, O>, Option<G>)
Turns this quad into a triple and its graph component.
sourcepub fn map_subject<U>(self, f: impl FnOnce(S) -> U) -> Quad<U, P, O, G>
pub fn map_subject<U>(self, f: impl FnOnce(S) -> U) -> Quad<U, P, O, G>
Maps the subject with the given function.
sourcepub fn map_predicate<U>(self, f: impl FnOnce(P) -> U) -> Quad<S, U, O, G>
pub fn map_predicate<U>(self, f: impl FnOnce(P) -> U) -> Quad<S, U, O, G>
Maps the subject with the given function.
sourcepub fn map_object<U>(self, f: impl FnOnce(O) -> U) -> Quad<S, P, U, G>
pub fn map_object<U>(self, f: impl FnOnce(O) -> U) -> Quad<S, P, U, G>
Maps the subject with the given function.
Trait Implementations§
source§impl<S, P, O, G> Display for Quad<S, P, O, G>where
S: RdfDisplay,
P: RdfDisplay,
O: RdfDisplay,
G: RdfDisplay,
impl<S, P, O, G> Display for Quad<S, P, O, G>where S: RdfDisplay, P: RdfDisplay, O: RdfDisplay, G: RdfDisplay,
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>,
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>,
type Output = Quad<<S as ExportFromVocabulary<V>>::Output, <P as ExportFromVocabulary<V>>::Output, <O as ExportFromVocabulary<V>>::Output, <G as ExportFromVocabulary<V>>::Output>
fn export_from_vocabulary( self, vocabulary: &V ) -> <Quad<S, P, O, G> as ExportFromVocabulary<V>>::Output
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>,
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>,
type Output = Quad<<S as ExportRefFromVocabulary<V>>::Output, <P as ExportRefFromVocabulary<V>>::Output, <O as ExportRefFromVocabulary<V>>::Output, <G as ExportRefFromVocabulary<V>>::Output>
fn export_ref_from_vocabulary( self, vocabulary: &V ) -> <Quad<S, P, O, G> as ExportRefFromVocabulary<V>>::Output
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>,
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
fn exported_from_vocabulary( &self, vocabulary: &V ) -> <Quad<S, P, O, G> as ExportedFromVocabulary<V>>::Output
V
. Read moresource§impl<S: Ord, P: Ord, O: Ord, G: Ord> Extend<Quad<S, P, O, G>> for BTreeDataset<S, P, O, G>
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)
fn extend<I: IntoIterator<Item = Quad<S, P, O, G>>>(&mut self, iter: I)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)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>
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)
fn extend<I: IntoIterator<Item = Quad<S, P, O, G>>>(&mut self, iter: I)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl<S: Ord, P: Ord, O: Ord, G: Ord> FromIterator<Quad<S, P, O, G>> for BTreeDataset<S, P, O, G>
impl<S: Ord, P: Ord, O: Ord, G: Ord> FromIterator<Quad<S, P, O, G>> for BTreeDataset<S, P, O, G>
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>
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§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>,
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>,
type Inserted = Quad<<S as InsertIntoVocabulary<V>>::Inserted, <P as InsertIntoVocabulary<V>>::Inserted, <O as InsertIntoVocabulary<V>>::Inserted, <G as InsertIntoVocabulary<V>>::Inserted>
fn insert_into_vocabulary( self, vocabulary: &mut V ) -> <Quad<S, P, O, G> as InsertIntoVocabulary<V>>::Inserted
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>,
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>,
type Inserted = Quad<<S as InsertedIntoVocabulary<V>>::Inserted, <P as InsertedIntoVocabulary<V>>::Inserted, <O as InsertedIntoVocabulary<V>>::Inserted, <G as InsertedIntoVocabulary<V>>::Inserted>
fn inserted_into_vocabulary( &self, vocabulary: &mut V ) -> <Quad<S, P, O, G> as InsertedIntoVocabulary<V>>::Inserted
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,
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>
type Interpreted = Quad<<S as Interpret<I>>::Interpreted, <P as Interpret<I>>::Interpreted, <O as Interpret<I>>::Interpreted, <G as Interpret<I>>::Interpreted>
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>,
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
fn map_literal( self, f: impl FnMut(T) -> U ) -> <Quad<S, P, O, G> as MapLiteral<T, U>>::Output
source§impl<S, P, O, G> Ord for Quad<S, P, O, G>where
S: Ord,
P: Ord,
O: Ord,
G: Ord,
impl<S, P, O, G> Ord for Quad<S, P, O, G>where S: Ord, P: Ord, O: Ord, G: Ord,
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
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>,
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§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>,
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>,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<S, P, O, G> RdfDisplay for Quad<S, P, O, G>where
S: RdfDisplay,
P: RdfDisplay,
O: RdfDisplay,
G: RdfDisplay,
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>,
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>,
type Output = Quad<<S as TryExportFromVocabulary<V>>::Output, <P as TryExportFromVocabulary<V>>::Output, <O as TryExportFromVocabulary<V>>::Output, <G as TryExportFromVocabulary<V>>::Output>
type Error = QuadExportFailed<<S as TryExportFromVocabulary<V>>::Error, <P as TryExportFromVocabulary<V>>::Error, <O as TryExportFromVocabulary<V>>::Error, <G as TryExportFromVocabulary<V>>::Error>
fn try_export_from_vocabulary( self, vocabulary: &V ) -> Result<<Quad<S, P, O, G> as TryExportFromVocabulary<V>>::Output, <Quad<S, P, O, G> as TryExportFromVocabulary<V>>::Error>
impl<S, P, O, G> Copy for Quad<S, P, O, G>where S: Copy, P: Copy, O: Copy, G: Copy,
impl<S, P, O, G> Eq for Quad<S, P, O, G>where S: Eq, P: Eq, O: Eq, G: Eq,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.