summaryrefslogtreecommitdiffhomepage
path: root/talpid-core/src
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2022-03-04 09:54:28 +0100
committerDavid Lönnhager <david.l@mullvad.net>2022-03-14 12:08:53 +0100
commite7bcd784a7f25be8b3b50e75b8adfad446125bc7 (patch)
tree5d53ee51217718c135618c065d3730d8166338df /talpid-core/src
parent9f5bc87ab6afa7f0b1c98c5cd9a101f39875641f (diff)
downloadmullvadvpn-e7bcd784a7f25be8b3b50e75b8adfad446125bc7.tar.xz
mullvadvpn-e7bcd784a7f25be8b3b50e75b8adfad446125bc7.zip
Implement talpid sender for futures sender
Diffstat (limited to 'talpid-core/src')
-rw-r--r--talpid-core/src/mpsc.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/talpid-core/src/mpsc.rs b/talpid-core/src/mpsc.rs
index 050b90c81c..8c6424bc01 100644
--- a/talpid-core/src/mpsc.rs
+++ b/talpid-core/src/mpsc.rs
@@ -3,3 +3,9 @@ pub trait Sender<T> {
/// Sends an item over the underlying channel, failing only if the channel is closed.
fn send(&self, item: T) -> Result<(), ()>;
}
+
+impl<E> Sender<E> for futures::channel::mpsc::UnboundedSender<E> {
+ fn send(&self, content: E) -> Result<(), ()> {
+ self.unbounded_send(content).map_err(|_| ())
+ }
+}