pub struct Quad<S = Subject, P = IriBuf, O = Object, G = GraphLabel>(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<S, L> Quad<Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>>
impl<S, L> Quad<Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>>
pub fn inserted_into<V: VocabularyMut>(
&self,
vocabulary: &mut V
) -> Triple<Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>>where
S: Clone,
L: Clone,
pub fn insert_into<V: VocabularyMut>(
self,
vocabulary: &mut V
) -> Triple<Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>>
source§impl<S, L> Quad<Subject, IriBuf, Object<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, GraphLabel>
impl<S, L> Quad<Subject, IriBuf, Object<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, GraphLabel>
pub fn inserted_into<V: VocabularyMut>(
&self,
vocabulary: &mut V
) -> Quad<Subject<V::Iri, V::BlankId>, V::Iri, Object<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, GraphLabel<V::Iri, V::BlankId>>where
S: Clone,
L: Clone,
pub fn insert_into<V: VocabularyMut>(
self,
vocabulary: &mut V
) -> Quad<Subject<V::Iri, V::BlankId>, V::Iri, Object<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, GraphLabel<V::Iri, V::BlankId>>
source§impl<S, L> Quad<Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>>
impl<S, L> Quad<Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>, Term<IriBuf, BlankIdBuf, Literal<S, IriBuf, L>>>
pub fn inserted_into<V: VocabularyMut>(
&self,
vocabulary: &mut V
) -> Quad<Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>>where
S: Clone,
L: Clone,
pub fn insert_into<V: VocabularyMut>(
self,
vocabulary: &mut V
) -> Quad<Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>, Term<V::Iri, V::BlankId, Literal<S, V::Iri, L>>>
source§impl<S, P, O, G> Quad<S, P, O, G>
impl<S, P, O, G> Quad<S, P, O, G>
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.
Examples found in repository?
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self.graph() {
Some(graph) => write!(
f,
"{} {} {} {}",
self.0.rdf_display(),
self.1.rdf_display(),
self.2.rdf_display(),
graph.rdf_display()
),
None => write!(
f,
"{} {} {}",
self.0.rdf_display(),
self.1.rdf_display(),
self.2.rdf_display()
),
}
}
}
impl<S: RdfDisplay, P: RdfDisplay, O: RdfDisplay, G: RdfDisplay> RdfDisplay for Quad<S, P, O, G> {
fn rdf_fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self.graph() {
Some(graph) => write!(
f,
"{} {} {} {}",
self.0.rdf_display(),
self.1.rdf_display(),
self.2.rdf_display(),
graph.rdf_display()
),
None => write!(
f,
"{} {} {}",
self.0.rdf_display(),
self.1.rdf_display(),
self.2.rdf_display()
),
}
}
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 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.
source§impl Quad<Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>>
impl Quad<Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>>
sourcepub fn as_grdf_quad_ref(&self) -> GrdfQuadRef<'_>
pub fn as_grdf_quad_ref(&self) -> GrdfQuadRef<'_>
source§impl<'a> Quad<Subject<Iri<'a>, &'a BlankId>, Iri<'a>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Subject<Iri<'a>, &'a BlankId>>
impl<'a> Quad<Subject<Iri<'a>, &'a BlankId>, Iri<'a>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Subject<Iri<'a>, &'a BlankId>>
sourcepub fn into_owned(self) -> Quad
pub fn into_owned(self) -> Quad
source§impl<'a> Quad<Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>>
impl<'a> Quad<Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>>
sourcepub fn into_owned(self) -> GrdfQuad
pub fn into_owned(self) -> GrdfQuad
Trait Implementations§
source§impl<S: RdfDisplay, P: RdfDisplay, O: RdfDisplay, G: RdfDisplay> Display for Quad<S, P, O, G>
impl<S: RdfDisplay, P: RdfDisplay, O: RdfDisplay, G: RdfDisplay> Display for Quad<S, P, O, G>
source§impl<'a> From<&'a Quad<Subject<IriBuf, BlankIdBuf>, IriBuf, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Subject<IriBuf, BlankIdBuf>>> for QuadRef<'a>
impl<'a> From<&'a Quad<Subject<IriBuf, BlankIdBuf>, IriBuf, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Subject<IriBuf, BlankIdBuf>>> for QuadRef<'a>
source§impl<'a> From<&'a Quad<Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>>> for GrdfQuadRef<'a>
impl<'a> From<&'a Quad<Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>>> for GrdfQuadRef<'a>
source§impl<'a> From<Quad<&'a Subject<IriBuf, BlankIdBuf>, &'a IriBuf, &'a Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, &'a Subject<IriBuf, BlankIdBuf>>> for QuadRef<'a>
impl<'a> From<Quad<&'a Subject<IriBuf, BlankIdBuf>, &'a IriBuf, &'a Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, &'a Subject<IriBuf, BlankIdBuf>>> for QuadRef<'a>
source§impl<'a> From<Quad<&'a Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, &'a Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, &'a Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, &'a Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>>> for GrdfQuadRef<'a>
impl<'a> From<Quad<&'a Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, &'a Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, &'a Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, &'a Term<IriBuf, BlankIdBuf, Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>>> for GrdfQuadRef<'a>
source§impl<'a> From<Quad<Subject<Iri<'a>, &'a BlankId>, Iri<'a>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Subject<Iri<'a>, &'a BlankId>>> for Quad
impl<'a> From<Quad<Subject<Iri<'a>, &'a BlankId>, Iri<'a>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Subject<Iri<'a>, &'a BlankId>>> for Quad
source§impl<'a> From<Quad<Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>>> for GrdfQuad
impl<'a> From<Quad<Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>, Term<Iri<'a>, &'a BlankId, &'a Literal<StringLiteral, IriBuf, LanguageTagBuf<Vec<u8, Global>>>>>> for GrdfQuad
source§fn from(q: GrdfQuadRef<'a>) -> Self
fn from(q: GrdfQuadRef<'a>) -> Self
source§impl<S: Ord, P: Ord, O: Ord, G: Ord> Ord for Quad<S, P, O, G>
impl<S: Ord, P: Ord, O: Ord, G: Ord> Ord for Quad<S, P, O, G>
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>, G1: PartialEq<G2>, S2, P2, O2, G2> PartialEq<Quad<S2, P2, O2, G2>> for Quad<S1, P1, O1, G1>
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§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>
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>
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 more