diff --git a/Cargo.toml b/Cargo.toml index f8d722ce..5a21ff77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,6 @@ rustc_version = "0.2" [dependencies] chrono = "0.4" failure = "0.1.1" -failure_derive = "0.1.1" lazy_static = "0.2" time = "0.1" uuid = { version = "0.5", features = ["v4", "serde"] } @@ -82,6 +81,9 @@ path = "query-sql" [dependencies.sql_traits] path = "sql-traits" +[dependencies.public_traits] +path = "public-traits" + [dependencies.mentat_tolstoy] path = "tolstoy" optional = true diff --git a/public-traits/Cargo.toml b/public-traits/Cargo.toml new file mode 100644 index 00000000..260add5f --- /dev/null +++ b/public-traits/Cargo.toml @@ -0,0 +1,45 @@ +[package] +name = "public_traits" +version = "0.0.1" +workspace = ".." + +[lib] +name = "public_traits" +path = "lib.rs" + +[features] +default = ["syncable"] +syncable = ["tolstoy_traits"] + +[dependencies] +failure = "0.1.1" +failure_derive = "0.1.1" + +[dependencies.rusqlite] +version = "0.13" +features = ["limits"] + +[dependencies.edn] +path = "../edn" + +[dependencies.core_traits] +path = "../core-traits" + +[dependencies.db_traits] +path = "../db-traits" + +[dependencies.query_algebrizer_traits] +path = "../query-algebrizer-traits" + +[dependencies.query_projector_traits] +path = "../query-projector-traits" + +[dependencies.query_pull_traits] +path = "../query-pull-traits" + +[dependencies.sql_traits] +path = "../sql-traits" + +[dependencies.tolstoy_traits] +path = "../tolstoy-traits" +optional = true diff --git a/src/errors.rs b/public-traits/errors.rs similarity index 100% rename from src/errors.rs rename to public-traits/errors.rs diff --git a/public-traits/lib.rs b/public-traits/lib.rs new file mode 100644 index 00000000..7cba001f --- /dev/null +++ b/public-traits/lib.rs @@ -0,0 +1,26 @@ +// Copyright 2018 Mozilla +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use +// this file except in compliance with the License. You may obtain a copy of the +// License at http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +extern crate failure; +#[macro_use] +extern crate failure_derive; + +extern crate rusqlite; + +extern crate edn; +extern crate core_traits; +extern crate db_traits; +extern crate query_pull_traits; +extern crate query_projector_traits; +extern crate query_algebrizer_traits; +extern crate tolstoy_traits; +extern crate sql_traits; + +pub mod errors; diff --git a/src/conn.rs b/src/conn.rs index 65ab8e65..dde86076 100644 --- a/src/conn.rs +++ b/src/conn.rs @@ -97,7 +97,7 @@ use entity_builder::{ TermBuilder, }; -use errors::{ +use public_traits::errors::{ Result, MentatError, }; diff --git a/src/entity_builder.rs b/src/entity_builder.rs index 64005247..0ae54f10 100644 --- a/src/entity_builder.rs +++ b/src/entity_builder.rs @@ -80,7 +80,7 @@ use conn::{ InProgress, }; -use errors::{ +use public_traits::errors::{ Result, }; diff --git a/src/lib.rs b/src/lib.rs index ffcb3f50..1d812f75 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,8 +10,6 @@ #![recursion_limit="128"] -#[macro_use] -extern crate failure_derive; extern crate failure; #[macro_use] @@ -34,6 +32,8 @@ extern crate mentat_query_pull; extern crate query_pull_traits; extern crate sql_traits; extern crate mentat_sql; +#[macro_use] +extern crate public_traits; #[cfg(feature = "syncable")] extern crate mentat_tolstoy; @@ -130,9 +130,8 @@ macro_rules! kw { }; } -#[macro_use] -pub mod errors; -pub use errors::{ +pub use public_traits::errors; +pub use public_traits::errors::{ MentatError, Result, }; diff --git a/src/query.rs b/src/query.rs index 044feacd..9ccfef12 100644 --- a/src/query.rs +++ b/src/query.rs @@ -76,7 +76,7 @@ pub use mentat_query_projector::{ RelResult, }; -use errors::{ +use public_traits::errors::{ MentatError, Result, }; diff --git a/src/query_builder.rs b/src/query_builder.rs index 6012f8d1..097eb439 100644 --- a/src/query_builder.rs +++ b/src/query_builder.rs @@ -36,7 +36,7 @@ use ::{ Variable, }; -use errors::{ +use public_traits::errors::{ MentatError, Result, }; diff --git a/src/store.rs b/src/store.rs index 9adfd423..05517ec8 100644 --- a/src/store.rs +++ b/src/store.rs @@ -59,7 +59,10 @@ use conn::{ Syncable, }; -use errors::*; +use public_traits::errors::{ + MentatError, + Result, +}; use query::{ PreparedResult,