multiqueue
multiqueue copied to clipboard
Make `SendError` visible / coercable
I'm attempting to use BroadcastFutReceiver
as a stream combinator to get a Clone
able stream that I can share across threads. I have tried something similar to the following:
fn cloneable<I, E, S>(stream: S) -> BroadcastFutReceiver<I>
where
I: Clone,
S: Stream<Item = I, Error = E>,
{
let (send, recv) = broadcast_fut_queue(1);
send.send_all(stream); // cannot coerce type E to type SendError<E>
recv
}
The issue I'm having is I'm not sure how to coerce my generic stream error type implementing T: std::error::Error
into a multiqueue::SendError<T>
as SendError
is not public.