tokio-rs / doc-push

Tokio doc blitz effort - A concerted effort to improve Tokio's documentation.
MIT License
50 stars 7 forks source link

What's the parameters passed to closures? #64

Open shaitao opened 6 years ago

shaitao commented 6 years ago

I saw in examples like .map(|_|{...}) .and_then(|(A,B)|{...}) .andthen(|(A,)|{...}) .and_then(|x|{...}) ... It's hard to find what is passed to the closure.

rawrmonstar commented 6 years ago

I believe the closures accept the result value of the previous future.

shaitao commented 6 years ago

I believe the closures accept the result value of the previous future.

yes it is, but many funcitons return future and Self::Item changes around, it's hard to find.

carllerche commented 6 years ago

Related #67

carllerche commented 6 years ago

We should be sure to answer this question as part of the combinator section in https://github.com/tokio-rs/doc-push/blob/master/outline/futures-streams-sinks.md#contents-1.