From 4e0af5fe0a9cc609ae287593baf7f7f60b75ef31 Mon Sep 17 00:00:00 2001 From: Mikhail Katychev Date: Wed, 17 Jul 2024 14:54:08 -0500 Subject: [PATCH] init commit --- api/src/dataset.rs | 2 +- api/src/graph.rs | 2 +- api/src/source.rs | 4 ++-- api/src/term.rs | 2 +- inmem/src/dataset.rs | 4 ++-- inmem/src/index.rs | 2 +- rio/src/parser.rs | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/src/dataset.rs b/api/src/dataset.rs index 81878d5a..8b4b00dc 100644 --- a/api/src/dataset.rs +++ b/api/src/dataset.rs @@ -56,7 +56,7 @@ pub trait Dataset { where Self: 'x; /// The error type that this dataset may raise. - type Error: Error + 'static; + type Error: Error + 'static + Send + Sync; /// An iterator visiting all quads of this dataset in arbitrary order. /// diff --git a/api/src/graph.rs b/api/src/graph.rs index f94432c6..631b46aa 100644 --- a/api/src/graph.rs +++ b/api/src/graph.rs @@ -53,7 +53,7 @@ pub trait Graph { where Self: 'x; /// The error type that this graph may raise. - type Error: Error + 'static; + type Error: Error + 'static + Send + Sync; /// An iterator visiting all triples of this graph in arbitrary order. /// diff --git a/api/src/source.rs b/api/src/source.rs index a90219a2..22a78497 100644 --- a/api/src/source.rs +++ b/api/src/source.rs @@ -87,7 +87,7 @@ pub trait Source { /// The type of items this source yields. type Item<'x>; /// The type of errors produced by this source. - type Error: Error + 'static; + type Error: Error + 'static + Send + Sync; /// Call f for some item(s) (possibly zero) from this source, if any. /// @@ -200,7 +200,7 @@ pub trait Source { impl<'a, I, T, E> Source for I where I: Iterator> + 'a, - E: Error + 'static, + E: Error + 'static + Send + Sync, { type Item<'x> = T; type Error = E; diff --git a/api/src/term.rs b/api/src/term.rs index 9348e15f..d51e928d 100644 --- a/api/src/term.rs +++ b/api/src/term.rs @@ -575,7 +575,7 @@ pub trait FromTerm: Sized { /// See also [`FromTerm`] pub trait TryFromTerm: Sized { /// The error type produced when failing to copy a given term - type Error: 'static + std::error::Error; + type Error: 'static + std::error::Error + Send + Sync; /// Try to copy `term` into an instance of this type. fn try_from_term(term: T) -> Result; } diff --git a/inmem/src/dataset.rs b/inmem/src/dataset.rs index e537f84b..ee81b14f 100644 --- a/inmem/src/dataset.rs +++ b/inmem/src/dataset.rs @@ -14,7 +14,7 @@ use _iter::*; /// A dataset with a single quad index (GSPO). /// Fast to load but slow on some queries, with a relatively low memory footprint. -#[derive(Clone, Debug, Default)] +#[derive(Clone, Debug, Default, PartialEq)] pub struct GenericLightDataset { terms: TI, quads: BTreeSet<[TI::Index; 4]>, @@ -194,7 +194,7 @@ impl SetDataset for GenericLightDataset {} /// A heavily indexed dataset. /// Fast to query but slow to load, with a relatively high memory footprint. -#[derive(Clone, Debug, Default)] +#[derive(Clone, Debug, Default, PartialEq)] pub struct GenericFastDataset { terms: TI, gspo: BTreeSet<[TI::Index; 4]>, diff --git a/inmem/src/index.rs b/inmem/src/index.rs index 6177e558..0f1df6ed 100644 --- a/inmem/src/index.rs +++ b/inmem/src/index.rs @@ -64,7 +64,7 @@ pub trait TermIndex { /// The type of [indices](Index) used by this [`TermIndex`] type Index: Index; /// The type of error that this [`TermIndex`] may raise - type Error: Error + 'static; + type Error: Error + 'static + Send + Sync; /// Get the index corresponding to term `t`, if it exists. /// diff --git a/rio/src/parser.rs b/rio/src/parser.rs index fb2edb90..4282477c 100644 --- a/rio/src/parser.rs +++ b/rio/src/parser.rs @@ -17,7 +17,7 @@ pub struct StrictRioTripleSource(pub T); impl sophia_api::source::Source for StrictRioTripleSource where T: rio_api::parser::TriplesParser, - T::Error: Error + 'static, + T::Error: Error + 'static + Send + Sync, { type Item<'x> = Trusted>; @@ -50,7 +50,7 @@ pub struct StrictRioQuadSource(pub T); impl sophia_api::source::Source for StrictRioQuadSource where T: rio_api::parser::QuadsParser, - T::Error: Error + 'static, + T::Error: Error + 'static + Send + Sync, { type Item<'x> = Trusted>; @@ -83,7 +83,7 @@ pub struct GeneralizedRioSource(pub T); impl sophia_api::source::Source for GeneralizedRioSource where T: rio_api::parser::GeneralizedQuadsParser, - T::Error: Error + 'static, + T::Error: Error + 'static + Send + Sync, { type Item<'x> = Trusted>;