Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "async-postgres"
version = "0.5.1"
version = "0.7.0"
authors = ["Hexilee <i@hexilee.me>"]
edition = "2018"
license = "MIT"
Expand All @@ -21,18 +21,18 @@ codecov = { repository = "Hexilee/async-postgres" }
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = "1.10"
bytes = "0.5"
tokio-postgres = { version = "0.5", default-features = false }
tokio = "0.2"
async-std = "1.6"
tokio = "1"
tokio-postgres = { version = "0.7", default-features = false }
futures = { version = "0.3", default-features = false }


[dev-dependencies]
async-std = { version = "1.6", features = ["attributes"] }
tokio = { version = "0.2", features = ["full"] }
tokio-postgres = "0.5"
postgres-native-tls = "0.3"
async-std = { version = "1.10", features = ["attributes"] }
tokio = { version = "1", features = ["full"] }
tokio-postgres = "0.7"
postgres-native-tls = "0.5"
native-tls = "0.2"

[features]
Expand All @@ -42,15 +42,15 @@ all-types = [
"with-bit-vec-0_6",
"with-chrono-0_4",
"with-eui48-0_4",
"with-geo-types-0_4",
# "with-geo-types-0_4",
"with-serde_json-1",
"with-uuid-0_8",
"with-time-0_2"
]
with-bit-vec-0_6 = ["tokio-postgres/with-bit-vec-0_6"]
with-chrono-0_4 = ["tokio-postgres/with-chrono-0_4"]
with-eui48-0_4 = ["tokio-postgres/with-eui48-0_4"]
with-geo-types-0_4 = ["tokio-postgres/with-geo-types-0_4"]
#with-geo-types-0_4 = ["tokio-postgres/with-geo-types-0_4"]
with-serde_json-1 = ["tokio-postgres/with-serde_json-1"]
with-uuid-0_8 = ["tokio-postgres/with-uuid-0_8"]
with-time-0_2 = ["tokio-postgres/with-time-0_2"]
15 changes: 5 additions & 10 deletions src/socket.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use async_std::io::{self, Read, Write};
use std::mem::MaybeUninit;
use std::pin::Pin;
use std::task::{Context, Poll};
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};

/// A alias for 'static + Unpin + Send + Read + Write
pub trait AsyncReadWriter: 'static + Unpin + Send + Read + Write {}
Expand All @@ -22,18 +21,14 @@ where
}

impl AsyncRead for Socket {
#[inline]
unsafe fn prepare_uninitialized_buffer(&self, _buf: &mut [MaybeUninit<u8>]) -> bool {
false
}

#[inline]
fn poll_read(
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<io::Result<usize>> {
Pin::new(&mut self.0).poll_read(cx, buf)
buf: &mut ReadBuf<'_>,
) -> Poll<io::Result<()>> {
let rawBuf = buf.filled_mut();
Pin::new(&mut self.0).poll_read(cx, rawBuf).map_ok(|_| ())
}
}

Expand Down