@@ -68,7 +68,7 @@ Here we're adding a dependency on three crates:
68
68
[ `mio` ] : https://crates.io/crates/mio
69
69
[ `tokio-core` ] : https://github.com/tokio-rs/tokio-core
70
70
[ `tokio-tls` ] : https://github.com/tokio-rs/tokio-tls
71
- [ `Future` ] : https://docs.rs/futures/0.1/futures/trait.Future.html
71
+ [ `Future` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html
72
72
[ `Stream` ] : https://docs.rs/futures/0.1/futures/stream/trait.Stream.html
73
73
[ Tokio ] : https://github.com/tokio-rs/tokio
74
74
@@ -176,7 +176,7 @@ takes a closure which receives the resolved value of this previous future. In
176
176
this case ` socket ` will have type [ ` TcpStream ` ] . The [ ` and_then ` ] closure,
177
177
however, will not run if [ ` TcpStream::connect ` ] returned an error.
178
178
179
- [ `and_then` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#method.and_then
179
+ [ `and_then` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#method.and_then
180
180
[ `TcpStream` ] : https://tokio-rs.github.io/tokio-core/tokio_core/net/struct.TcpStream.html
181
181
182
182
Once we have our ` socket ` , we create a client TLS context via
@@ -357,7 +357,7 @@ method directly. Rather, you interact with futures through [combinators] that
357
357
create higher-level abstractions around futures. But it's useful to our
358
358
understanding if we have a sense of how futures work under the hood.
359
359
360
- [ `poll` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#tymethod.poll
360
+ [ `poll` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#tymethod.poll
361
361
362
362
Let's take a closer look at [ ` poll ` ] . Notice the ` &mut self ` argument, which
363
363
conveys a number of restrictions and abilities:
@@ -455,14 +455,14 @@ The combinators on futures allow expressing concepts like:
455
455
456
456
[ `Iterator` ] : https://doc.rust-lang.org/std/iter/trait.Iterator.html
457
457
[ `Box` ] : https://doc.rust-lang.org/std/boxed/struct.Box.html
458
- [ `map` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#method.map
459
- [ `map_err` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#method.map_err
460
- [ `then` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#method.then
461
- [ `and_then` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#method.and_then
462
- [ `or_else` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#method.or_else
463
- [ `select` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#method.select
464
- [ `join` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#method.join
465
- [ `fuse` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#method.fuse
458
+ [ `map` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#method.map
459
+ [ `map_err` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#method.map_err
460
+ [ `then` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#method.then
461
+ [ `and_then` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#method.and_then
462
+ [ `or_else` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#method.or_else
463
+ [ `select` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#method.select
464
+ [ `join` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#method.join
465
+ [ `fuse` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#method.fuse
466
466
467
467
Usage of the combinators should feel very similar to the [ ` Iterator ` ] trait in
468
468
Rust or [ futures in Scala] [ scala-futures ] . Most composition of futures ends up
@@ -715,7 +715,7 @@ In situations though where a value isn't immediately ready, there are also
715
715
more general implementations of [ ` Future ` ] and [ ` Stream ` ] that are available in
716
716
the [ ` futures ` ] crate, the first of which is [ ` oneshot ` ] . Let's take a look:
717
717
718
- [ `oneshot` ] : https://docs.rs/futures/0.1/futures/fn.oneshot.html
718
+ [ `oneshot` ] : https://docs.rs/futures/0.1/futures/sync/ fn.oneshot.html
719
719
720
720
``` rust
721
721
extern crate futures;
@@ -827,7 +827,7 @@ generally introduce allocations), it's only at the fringe that a `Box` comes
827
827
into effect.
828
828
829
829
[ trait object ] : https://doc.rust-lang.org/book/trait-objects.html
830
- [ `boxed` ] : https://docs.rs/futures/0.1/futures/trait.Future.html#method.boxed
830
+ [ `boxed` ] : https://docs.rs/futures/0.1/futures/future/ trait.Future.html#method.boxed
831
831
832
832
### Custom types
833
833
[ return-custom-types ] : #custom-types
@@ -894,7 +894,7 @@ Sometimes the types can get quite large or be unnameable altogether. Here we're
894
894
using a function pointer (` fn(i32) -> i32 ` ) but we would ideally use a closure.
895
895
Unfortunately the return type cannot name the closure, for now.
896
896
897
- [ `Map` ] : https://docs.rs/futures/0.1/futures/struct.Map.html
897
+ [ `Map` ] : https://docs.rs/futures/0.1/futures/future/ struct.Map.html
898
898
899
899
### ` impl Trait `
900
900
[ return-impl-trait ] : #impl-trait
0 commit comments