Skip to content

Instantly share code, notes, and snippets.

@46bit
Created June 5, 2017 21:56
Show Gist options
  • Select an option

  • Save 46bit/d588265b84f3ed3f54216e0aa674a33f to your computer and use it in GitHub Desktop.

Select an option

Save 46bit/d588265b84f3ed3f54216e0aa674a33f to your computer and use it in GitHub Desktop.
fn query<R>(&self,
query: QueryForReply<Id, Definition>,
reply_rx: oneshot::Receiver<R>)
-> Box<Future<Item = R, Error = bool>>
where R: Send + 'static
{
self.query_tx
.clone()
.send(query)
.map_err(|_| false)
.and_then(|_| reply_rx.map_err(|_| false))
.boxed()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment