mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-02 00:00:11 +02:00
Use Sink trait from futures-sink-preview (#1244)
This commit is contained in:
@@ -22,11 +22,11 @@ categories = ["asynchronous"]
|
||||
publish = false
|
||||
|
||||
[features]
|
||||
async-traits = ["async-sink", "futures-core-preview"]
|
||||
async-traits = ["tokio-futures", "futures-core-preview"]
|
||||
|
||||
[dependencies]
|
||||
async-util = { git = "https://github.com/tokio-rs/async" }
|
||||
async-sink = { git = "https://github.com/tokio-rs/async", optional = true }
|
||||
tokio-futures = { path = "../tokio-futures", optional = true }
|
||||
fnv = "1.0.6"
|
||||
futures-core-preview = { version = "0.3.0-alpha.17", optional = true }
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ impl<T> Sender<T> {
|
||||
}
|
||||
|
||||
#[cfg(feature = "async-traits")]
|
||||
impl<T> async_sink::Sink<T> for Sender<T> {
|
||||
impl<T> tokio_futures::Sink<T> for Sender<T> {
|
||||
type Error = SendError;
|
||||
|
||||
fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
|
||||
@@ -130,7 +130,7 @@ impl<T> UnboundedSender<T> {
|
||||
}
|
||||
|
||||
#[cfg(feature = "async-traits")]
|
||||
impl<T> async_sink::Sink<T> for UnboundedSender<T> {
|
||||
impl<T> tokio_futures::Sink<T> for UnboundedSender<T> {
|
||||
type Error = UnboundedSendError;
|
||||
|
||||
fn poll_ready(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
|
||||
@@ -367,7 +367,7 @@ impl<T> Sender<T> {
|
||||
}
|
||||
|
||||
#[cfg(feature = "async-traits")]
|
||||
impl<T> async_sink::Sink<T> for Sender<T> {
|
||||
impl<T> tokio_futures::Sink<T> for Sender<T> {
|
||||
type Error = error::SendError<T>;
|
||||
|
||||
fn poll_ready(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
|
||||
@@ -56,9 +56,9 @@ async fn async_send_recv_with_buffer() {
|
||||
#[test]
|
||||
#[cfg(feature = "async-traits")]
|
||||
fn send_sink_recv_with_buffer() {
|
||||
use async_sink::Sink;
|
||||
use futures_core::Stream;
|
||||
use pin_utils::pin_mut;
|
||||
use tokio_futures::Sink;
|
||||
|
||||
let mut t1 = MockTask::new();
|
||||
|
||||
@@ -169,9 +169,9 @@ async fn async_send_recv_unbounded() {
|
||||
#[test]
|
||||
#[cfg(feature = "async-traits")]
|
||||
fn sink_send_recv_unbounded() {
|
||||
use async_sink::Sink;
|
||||
use futures_core::Stream;
|
||||
use pin_utils::pin_mut;
|
||||
use tokio_futures::Sink;
|
||||
|
||||
let mut t1 = MockTask::new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user