pub struct Triple<S = Id, P = IriBuf, O = Object>(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>>
impl<I, B, L> Triple<Id<I, B>, I, Term<Id<I, B>, L>>
pub fn into_grdf(self) -> GrdfTriple<Id<I, B>, L>
source§impl<S, P, O> Triple<S, P, O>
impl<S, P, O> Triple<S, P, O>
sourcepub fn subject(&self) -> &S
pub fn subject(&self) -> &S
Returns a reference to the subject of the triple, 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 triple, the first component.
sourcepub fn into_subject(self) -> S
pub fn into_subject(self) -> S
Turns the triple into its subject, the first component.
sourcepub fn predicate(&self) -> &P
pub fn predicate(&self) -> &P
Returns a reference to the predicate of the triple, 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 triple, the second component.
sourcepub fn into_predicate(self) -> P
pub fn into_predicate(self) -> P
Turns the triple into its predicate, the second component.
sourcepub fn object(&self) -> &O
pub fn object(&self) -> &O
Returns a reference to the object of the triple, the third 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 triple, the third component.
sourcepub fn into_object(self) -> O
pub fn into_object(self) -> O
Turns the triple into its object, the third component.
sourcepub fn into_parts(self) -> (S, P, O)
pub fn into_parts(self) -> (S, P, O)
Turns the triple into a tuple
sourcepub fn into_quad<G>(self, graph: Option<G>) -> Quad<S, P, O, G>
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.
sourcepub fn map_subject<U>(self, f: impl FnOnce(S) -> U) -> Triple<U, P, O>
pub fn map_subject<U>(self, f: impl FnOnce(S) -> U) -> Triple<U, P, O>
Maps the subject with the given function.
sourcepub fn map_predicate<U>(self, f: impl FnOnce(P) -> U) -> Triple<S, U, O>
pub fn map_predicate<U>(self, f: impl FnOnce(P) -> U) -> Triple<S, U, O>
Maps the subject with the given function.
sourcepub fn map_object<U>(self, f: impl FnOnce(O) -> U) -> Triple<S, P, U>
pub fn map_object<U>(self, f: impl FnOnce(O) -> U) -> Triple<S, P, U>
Maps the subject with the given function.
Trait Implementations§
source§impl<S: RdfDisplay, P: RdfDisplay, O: RdfDisplay> Display for Triple<S, P, O>
impl<S: RdfDisplay, P: RdfDisplay, O: RdfDisplay> Display for Triple<S, P, O>
source§impl<V, S: InsertIntoVocabulary<V>, P: InsertIntoVocabulary<V>, O: InsertIntoVocabulary<V>> InsertIntoVocabulary<V> for Triple<S, P, O>
impl<V, S: InsertIntoVocabulary<V>, P: InsertIntoVocabulary<V>, O: InsertIntoVocabulary<V>> InsertIntoVocabulary<V> for Triple<S, P, O>
type Inserted = Triple<<S as InsertIntoVocabulary<V>>::Inserted, <P as InsertIntoVocabulary<V>>::Inserted, <O as InsertIntoVocabulary<V>>::Inserted>
fn insert_into_vocabulary(self, vocabulary: &mut V) -> Self::Inserted
source§impl<V, S: InsertedIntoVocabulary<V>, P: InsertedIntoVocabulary<V>, O: InsertedIntoVocabulary<V>> InsertedIntoVocabulary<V> for Triple<S, P, O>
impl<V, S: InsertedIntoVocabulary<V>, P: InsertedIntoVocabulary<V>, O: InsertedIntoVocabulary<V>> InsertedIntoVocabulary<V> for Triple<S, P, O>
type Inserted = Triple<<S as InsertedIntoVocabulary<V>>::Inserted, <P as InsertedIntoVocabulary<V>>::Inserted, <O as InsertedIntoVocabulary<V>>::Inserted>
fn inserted_into_vocabulary(&self, vocabulary: &mut V) -> Self::Inserted
source§impl<S: MapLiteral<T, U>, P: MapLiteral<T, U>, O: MapLiteral<T, U>, T, U> MapLiteral<T, U> for Triple<S, P, O>
impl<S: MapLiteral<T, U>, P: MapLiteral<T, U>, O: MapLiteral<T, U>, T, U> MapLiteral<T, U> for Triple<S, P, O>
type Output = Triple<<S as MapLiteral<T, U>>::Output, <P as MapLiteral<T, U>>::Output, <O as MapLiteral<T, U>>::Output>
source§fn map_literal(self, f: impl FnMut(T) -> U) -> Self::Output
fn map_literal(self, f: impl FnMut(T) -> U) -> Self::Output
source§impl<S: Ord, P: Ord, O: Ord> Ord for Triple<S, P, O>
impl<S: Ord, P: Ord, O: Ord> Ord for Triple<S, P, O>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl<S1: PartialEq<S2>, P1: PartialEq<P2>, O1: PartialEq<O2>, S2, P2, O2> PartialEq<Triple<S2, P2, O2>> for Triple<S1, P1, O1>
impl<S1: PartialEq<S2>, P1: PartialEq<P2>, O1: PartialEq<O2>, S2, P2, O2> PartialEq<Triple<S2, P2, O2>> for Triple<S1, P1, O1>
source§impl<S1: PartialOrd<S2>, P1: PartialOrd<P2>, O1: PartialOrd<O2>, S2, P2, O2> PartialOrd<Triple<S2, P2, O2>> for Triple<S1, P1, O1>
impl<S1: PartialOrd<S2>, P1: PartialOrd<P2>, O1: PartialOrd<O2>, S2, P2, O2> PartialOrd<Triple<S2, P2, O2>> for Triple<S1, P1, O1>
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: RdfDisplay, P: RdfDisplay, O: RdfDisplay> RdfDisplay for Triple<S, P, O>
impl<S: RdfDisplay, P: RdfDisplay, O: RdfDisplay> RdfDisplay for Triple<S, P, O>
fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
fn rdf_display(&self) -> RdfDisplayed<&Self>
impl<S: Copy, P: Copy, O: Copy> Copy for Triple<S, P, O>
impl<S: Eq, P: Eq, O: Eq> Eq for Triple<S, P, O>
impl<S, P, O> StructuralEq for Triple<S, P, O>
Auto Trait Implementations§
impl<S, P, O> RefUnwindSafe for Triple<S, P, O>where O: RefUnwindSafe, P: RefUnwindSafe, S: RefUnwindSafe,
impl<S, P, O> Send for Triple<S, P, O>where O: Send, P: Send, S: Send,
impl<S, P, O> Sync for Triple<S, P, O>where O: Sync, P: Sync, S: Sync,
impl<S, P, O> Unpin for Triple<S, P, O>where O: Unpin, P: Unpin, S: Unpin,
impl<S, P, O> UnwindSafe for Triple<S, P, O>where 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.