aboutsummaryrefslogtreecommitdiff
path: root/crates/thread_worker/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/thread_worker/src/lib.rs')
-rw-r--r--crates/thread_worker/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/thread_worker/src/lib.rs b/crates/thread_worker/src/lib.rs
index 12e8bf17e..5e46f62fe 100644
--- a/crates/thread_worker/src/lib.rs
+++ b/crates/thread_worker/src/lib.rs
@@ -2,7 +2,7 @@
2 2
3use std::thread; 3use std::thread;
4 4
5use crossbeam_channel::{bounded, unbounded, Receiver, Sender}; 5use crossbeam_channel::{bounded, unbounded, Receiver, Sender, RecvError, SendError};
6use drop_bomb::DropBomb; 6use drop_bomb::DropBomb;
7 7
8pub struct Worker<I, O> { 8pub struct Worker<I, O> {
@@ -34,10 +34,10 @@ impl<I, O> Worker<I, O> {
34 self.out 34 self.out
35 } 35 }
36 36
37 pub fn send(&self, item: I) { 37 pub fn send(&self, item: I) -> Result<(), SendError<I>> {
38 self.inp.send(item) 38 self.inp.send(item)
39 } 39 }
40 pub fn recv(&self) -> Option<O> { 40 pub fn recv(&self) -> Result<O, RecvError> {
41 self.out.recv() 41 self.out.recv()
42 } 42 }
43} 43}