Skip to content

Instantly share code, notes, and snippets.

View pimeys's full-sized avatar

Julius de Bruijn pimeys

View GitHub Profile
org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring project ':app'.
at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:99)
at org.gradle.initialization.exception.DefaultExceptionAnalyser.collectFailures(DefaultExceptionAnalyser.java:62)
at org.gradle.initialization.exception.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:48)
at org.gradle.initialization.exception.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
at org.gradle.initialization.DefaultGradleLauncher.finishBuild(DefaultGradleLauncher.java:162)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:129)
at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.java:100)
at org.gradle.internal.invocation.GradleBuildController$2.execute(GradleBuildController.java:70)
at org.gradle.internal.invocat
diff --git a/src/postgres.rs b/src/postgres.rs
index c36c165..7d14b27 100644
--- a/src/postgres.rs
+++ b/src/postgres.rs
@@ -1,4 +1,4 @@
-use byteorder::{BigEndian, ReadBytesExt};
+use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use bytes::{BytesMut, BufMut};
use num::Zero;
use crate::Decimal;
error: ambiguous `+` in a type
--> src/connector/postgres/conversion.rs:19:14
|
19 | ) -> Vec<&'a dyn tokio_postgres::types::ToSql + Sync> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(dyn tokio_postgres::types::ToSql + Sync)`
error[E0277]: `dyn core::future::future::Future<Output = std::result::Result<postgres_types::Type, tokio_postgres::error::Error>> + std::marker::Send` cannot be shared between threads safely
--> src/connector/postgres.rs:247:9
|
247 | metrics::query("postgres.execute", &sql, &params, || {
@pimeys
pimeys / output
Last active September 12, 2019 14:03
error[E0277]: `(dyn futures_core::stream::Stream<Item = std::result::Result<bytes::bytes::Bytes, std::io::Error>> + std::marker::Send + 'static)` cannot be shared between threads safely
--> src/main.rs:104:22
|
104 | app.at("/:name").get(run_query).post(save_query);
| ^^^ `(dyn futures_core::stream::Stream<Item = std::result::Result<bytes::bytes::Bytes, std::io::Error>> + std::marker::Send + 'static)` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `(dyn futures_core::stream::Stream<Item = std::result::Result<bytes::bytes::Bytes, std::io::Error>> + std::marker::Send + 'static)`
= note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<(dyn futures_core::stream::Stream<Item = std::result::Result<bytes::bytes::Bytes, std::io::Error>> + std::marker::Send + 'static)>`
= note: required because it appears within the type `std::boxed::Box<(dyn futures_core::stream::St
use futures::future::{Future, err};
fn main() {
let future = err("CRASH").map_err(|e| panic!("{:?}", e));
tokio::run(future);
}
error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely
--> src/lib.rs:216:24
|
216 | AlpnConnecting(Box::pin(fut))
| ^^^^^^^^^^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely
|
= help: within `core::fmt::Void`, the trait `std::marker::Sync` is not implemented for `*mut (dyn std::ops::Fn() + 'static)`
= note: required because it appears within the type `std::marker::PhantomData<*mut (dyn std::ops::Fn() + 'static)>`
= note: required because it appears within the type `core::fmt::Void`
= note: required because of the requirements on the impl of `std::marker::Send` for `&core::fmt::Void`
#![feature(async_await, await_macro)]
#![recursion_limit = "128"]
use futures01::future::lazy;
use futures03::future::{FutureExt, TryFutureExt};
pub struct Server {
name: String,
}
const result = await photon.users.findMany({
select: {
id: true,
dateOfBirth: true
}
})
index 082d750..4e45291 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -91,11 +91,7 @@ pub struct Client {
impl Client {
/// Send a query to Fauna servers and parsing the response.
- pub fn query<'a, Q>(&self, query: Q) -> FutureResponse<Response>
- where
- Q: Into<Expr<'a>>,
#[test]
fn test_select() {
let mut path = Array::from(vec!["favorites", "foods"]);
path.push(1);
let mut fun = Select::new(path, Get::instance(Ref::instance("musti")));
fun.default("Chicken hearts");
let query = Query::from(fun);
let serialized = serde_json::to_value(&query).unwrap();