Skip to content

Instantly share code, notes, and snippets.

fn sometest(c: future::Loop<u32,u32>) -> impl Future<Item=future::Loop<u32,u32>,Error=u32>
{
let delay = if let future::Loop::Continue(_) = c {
Instant::now().add(Duration::from_secs(1))
} else {
Instant::now()
};
let res = Delay::new(delay)
fn sometestbox(
c: future::Loop<u32, u32>,
) -> Box<Future<Item = future::Loop<u32, u32>, Error = u32> + Send> {
if let future::Loop::Continue(i) = c {
let delay = Instant::now().add(Duration::from_secs(1));
Box::new(
Delay::new(delay)
.map(move |_| future::Loop::Continue(i))
.map_err(|_| 1)
@drorlevywork
drorlevywork / keybase.md
Created October 1, 2019 09:48
keybase proof

Keybase proof

I hereby claim:

  • I am drorlevywork on github.
  • I am drorlevy (https://keybase.io/drorlevy) on keybase.
  • I have a public key ASA3-VERCZnS8hA08FXigtiCvvQCmJfyYGu64Z6_OdwT3Ao

To claim this, I am signing this object: