Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Last active May 4, 2020 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bahamas10/da47325f95586bf7665a50ca3e7fdbdd to your computer and use it in GitHub Desktop.
Save bahamas10/da47325f95586bf7665a50ca3e7fdbdd to your computer and use it in GitHub Desktop.
cueball postgres rust mdapi
diff --git a/utils/Cargo.toml b/utils/Cargo.toml
index 11b114c..e08a152 100644
--- a/utils/Cargo.toml
+++ b/utils/Cargo.toml
@@ -9,7 +9,7 @@ edition = "2018"
clap = "2.32"
cueball = "0.3.3"
cueball-manatee-primary-resolver = "0.3.0"
-cueball-postgres-connection = "0.3.0"
+cueball-postgres-connection = { git = "https://github.com/joyent/rust-cueball", branch = "master" }
itertools = "0.8.2"
num_cpus = { version = "1.8.0" }
slog = { version = "2.4.1", features = [ "max_level_trace" ] }

I applied this simple patch, ran cargo update followed by cargo build in the utils directory of buckets-mdapi

dave - temple linux ~/dev/buckets/buckets-mdapi/utils (git:master) $ cargo build
Compiling libc v0.2.69
Compiling autocfg v1.0.0
Compiling cfg-if v0.1.10
Compiling lazy_static v1.4.0
Compiling log v0.4.8
Compiling byteorder v1.3.4
Compiling maybe-uninit v2.0.0
Compiling rand_core v0.4.2
...
...
...
error[E0277]: expected a `std::ops::FnMut<(&cueball::backend::Backend,)>` closure, found `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
--> utils/src/schema.rs:97:58
|
97 | ConnectionPool::new(pool_opts, resolver, connection_creator);
| ^^^^^^^^^^^^^^^^^^ expected an `FnMut<(&cueball::backend::Backend,)>` closure, found `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
|
= help: the trait `for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>` is not implemented for `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
= note: required by `cueball::connection_pool::ConnectionPool::<C, R, F>::new`
error[E0277]: expected a `std::ops::FnOnce<(&cueball::backend::Backend,)>` closure, found `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
--> utils/src/schema.rs:97:58
|
97 | ConnectionPool::new(pool_opts, resolver, connection_creator);
| ^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&cueball::backend::Backend,)>` closure, found `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
|
= help: the trait `std::ops::FnOnce<(&cueball::backend::Backend,)>` is not implemented for `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
= note: required by `cueball::connection_pool::ConnectionPool::<C, R, F>::new`
error[E0277]: expected a `std::ops::FnMut<(&cueball::backend::Backend,)>` closure, found `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
--> utils/src/schema.rs:97:17
|
97 | ConnectionPool::new(pool_opts, resolver, connection_creator);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnMut<(&cueball::backend::Backend,)>` closure, found `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
|
= help: the trait `for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>` is not implemented for `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
= note: required by `cueball::connection_pool::ConnectionPool`
error[E0277]: expected a `std::ops::FnOnce<(&cueball::backend::Backend,)>` closure, found `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
--> utils/src/schema.rs:97:17
|
97 | ConnectionPool::new(pool_opts, resolver, connection_creator);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&cueball::backend::Backend,)>` closure, found `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
|
= help: the trait `std::ops::FnOnce<(&cueball::backend::Backend,)>` is not implemented for `impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>`
= note: required by `cueball::connection_pool::ConnectionPool`
error[E0599]: no method named `claim` found for type `cueball::connection_pool::ConnectionPool<_, R, impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>>` in the current scope
--> utils/src/schema.rs:99:18
|
99 | pool.claim()
| ^^^^^ method not found in `cueball::connection_pool::ConnectionPool<_, R, impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)>>`
|
= note: the method `claim` exists but the following trait bounds were not satisfied:
`impl for<'r> std::ops::FnMut<(&'r cueball::backend::Backend,)> : std::ops::FnMut<(&cueball::backend::Backend,)>`
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `utils`.
To learn more, run the command again with --verbose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment