Struct rdf_types::Triple

source ·
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>>

source

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

source§

impl<S, P, O> Triple<S, P, O>

source

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

Creates a new triple.

source

pub fn subject(&self) -> &S

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

source

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

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

source

pub fn into_subject(self) -> S

Turns the triple into its subject, the first component.

source

pub fn predicate(&self) -> &P

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

source

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

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

source

pub fn into_predicate(self) -> P

Turns the triple into its predicate, the second component.

source

pub fn object(&self) -> &O

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

source

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

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

source

pub fn into_object(self) -> O

Turns the triple into its object, the third component.

source

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

Turns the triple into a tuple

source

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.

source

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

Maps the subject with the given function.

source

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

Maps the subject with the given function.

source

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

Maps the subject with the given function.

source§

impl<L> Triple<Id, IriBuf, Object<Id, L>>

source

pub fn as_triple_ref(&self) -> TripleRef<'_, L>

source§

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

source

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

Trait Implementations§

source§

impl<S: Clone, P: Clone, O: Clone> Clone for Triple<S, P, O>

source§

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

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> Debug for Triple<S, P, O>

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> Display for Triple<S, P, O>

source§

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

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

impl<S: Hash, P: Hash, O: Hash> Hash for Triple<S, P, O>

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<V, S: InsertIntoVocabulary<V>, P: InsertIntoVocabulary<V>, O: InsertIntoVocabulary<V>> InsertIntoVocabulary<V> for Triple<S, P, O>

source§

impl<V, S: InsertedIntoVocabulary<V>, P: InsertedIntoVocabulary<V>, O: InsertedIntoVocabulary<V>> InsertedIntoVocabulary<V> for Triple<S, P, O>

source§

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

Maps RDF literal values.
source§

impl<S: Ord, P: Ord, O: Ord> Ord for Triple<S, P, O>

source§

fn cmp(&self, other: &Triple<S, P, O>) -> 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<Self>,

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

impl<S1: PartialEq<S2>, P1: PartialEq<P2>, O1: PartialEq<O2>, S2, P2, O2> PartialEq<Triple<S2, P2, O2>> for Triple<S1, P1, O1>

source§

fn eq(&self, other: &Triple<S2, P2, O2>) -> 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>, S2, P2, O2> PartialOrd<Triple<S2, P2, O2>> for Triple<S1, P1, O1>

source§

fn partial_cmp(&self, other: &Triple<S2, P2, O2>) -> 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> RdfDisplay for Triple<S, P, O>

source§

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

source§

fn rdf_display(&self) -> RdfDisplayed<&Self>

source§

impl<S: Copy, P: Copy, O: Copy> Copy for Triple<S, P, O>

source§

impl<S: Eq, P: Eq, O: Eq> Eq for Triple<S, P, O>

source§

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