1pub(crate) mod ct;
4pub(crate) mod err;
5pub(crate) mod keyed_futures_unordered;
6pub(crate) mod notify;
7pub(crate) mod oneshot_broadcast;
8pub(crate) mod skew;
9pub(crate) mod sometimes_unbounded_sink;
10pub(crate) mod stream_poll_set;
11pub(crate) mod token_bucket;
12pub(crate) mod ts;
13
14use futures::Sink;
15use std::pin::Pin;
16use std::task::{Context, Poll};
17
18pub(crate) trait SinkExt<T>: Sink<T> {
20 fn poll_ready_unpin_bool(&mut self, cx: &mut Context<'_>) -> Result<bool, Self::Error>
26 where
27 Self: Unpin,
28 {
29 Ok(match Sink::poll_ready(Pin::new(self), cx) {
30 Poll::Ready(Ok(())) => true,
31 Poll::Ready(Err(e)) => return Err(e),
32 Poll::Pending => false,
33 })
34 }
35}
36impl<T, S: Sink<T>> SinkExt<T> for S {}
37
38#[cfg(any(test, feature = "testing"))]
43pub(crate) fn fake_mq<A: crate::memquota::SpecificAccount>() -> A {
44 A::new_noop()
45}