use core::fmt;
use core::marker::PhantomData;
use core::pin::Pin;
use futures_core::task::{Context, Poll};
use futures_sink::Sink;
#[derive(Debug)]
#[must_use = "futures do nothing unless polled"]
pub struct Drain<T> {
marker: PhantomData<T>,
}
#[derive(Debug)]
pub enum DrainError {
}
pub fn drain<T>() -> Drain<T> {
Drain { marker: PhantomData }
}
impl<T> Sink<T> for Drain<T> {
type SinkError = DrainError;
fn poll_ready(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::SinkError>> {
Poll::Ready(Ok(()))
}
fn start_send(
self: Pin<&mut Self>,
_item: T,
) -> Result<(), Self::SinkError> {
Ok(())
}
fn poll_flush(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::SinkError>> {
Poll::Ready(Ok(()))
}
fn poll_close(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::SinkError>> {
Poll::Ready(Ok(()))
}
}
impl fmt::Display for DrainError {
fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
}
}
}
#[cfg(feature = "std")]
impl std::error::Error for DrainError {
}
impl DrainError {
pub fn into_any<T>(self) -> T {
match self {
}
}
}