@@ -140,15 +140,16 @@ pub mod codec {
140
140
//! configuration values.
141
141
//!
142
142
//! ```
143
- //! # extern crate tokio_io ;
144
- //! use tokio_io ::{AsyncRead, AsyncWrite};
145
- //! use tokio_io ::codec::length_delimited;
143
+ //! # extern crate tokio ;
144
+ //! use tokio::io ::{AsyncRead, AsyncWrite};
145
+ //! use tokio ::codec::length_delimited;
146
146
//!
147
147
//! fn bind_transport<T: AsyncRead + AsyncWrite>(io: T)
148
148
//! -> length_delimited::Framed<T>
149
149
//! {
150
150
//! length_delimited::Framed::new(io)
151
151
//! }
152
+ //! # pub fn main() {}
152
153
//! ```
153
154
//!
154
155
//! The returned transport implements `Sink + Stream` for `BytesMut`. It
@@ -164,12 +165,12 @@ pub mod codec {
164
165
//! Specifically, given the following:
165
166
//!
166
167
//! ```
167
- //! # extern crate tokio_io ;
168
+ //! # extern crate tokio ;
168
169
//! # extern crate bytes;
169
170
//! # extern crate futures;
170
171
//! #
171
- //! use tokio_io ::{AsyncRead, AsyncWrite};
172
- //! use tokio_io ::codec::length_delimited;
172
+ //! use tokio::io ::{AsyncRead, AsyncWrite};
173
+ //! use tokio ::codec::length_delimited;
173
174
//! use bytes::BytesMut;
174
175
//! use futures::{Sink, Future};
175
176
//!
@@ -205,9 +206,9 @@ pub mod codec {
205
206
//! frame head in the yielded `BytesMut`.
206
207
//!
207
208
//! ```
208
- //! # extern crate tokio_io ;
209
- //! # use tokio_io ::AsyncRead;
210
- //! # use tokio_io ::codec::length_delimited;
209
+ //! # extern crate tokio ;
210
+ //! # use tokio::io ::AsyncRead;
211
+ //! # use tokio ::codec::length_delimited;
211
212
//! # fn bind_read<T: AsyncRead>(io: T) {
212
213
//! length_delimited::Builder::new()
213
214
//! .length_field_offset(0) // default value
@@ -216,6 +217,7 @@ pub mod codec {
216
217
//! .num_skip(0) // Do not strip frame header
217
218
//! .new_read(io);
218
219
//! # }
220
+ //! # pub fn main() {}
219
221
//! ```
220
222
//!
221
223
//! The following frame will be decoded as such:
@@ -239,9 +241,9 @@ pub mod codec {
239
241
//! frame head in the yielded `BytesMut`.
240
242
//!
241
243
//! ```
242
- //! # extern crate tokio_io ;
243
- //! # use tokio_io ::AsyncRead;
244
- //! # use tokio_io ::codec::length_delimited;
244
+ //! # extern crate tokio ;
245
+ //! # use tokio::io ::AsyncRead;
246
+ //! # use tokio ::codec::length_delimited;
245
247
//! # fn bind_read<T: AsyncRead>(io: T) {
246
248
//! length_delimited::Builder::new()
247
249
//! .length_field_offset(0) // default value
@@ -250,6 +252,7 @@ pub mod codec {
250
252
//! // `num_skip` is not needed, the default is to skip
251
253
//! .new_read(io);
252
254
//! # }
255
+ //! # pub fn main() {}
253
256
//! ```
254
257
//!
255
258
//! The following frame will be decoded as such:
@@ -271,9 +274,9 @@ pub mod codec {
271
274
//! **includes** the frame head length.
272
275
//!
273
276
//! ```
274
- //! # extern crate tokio_io ;
275
- //! # use tokio_io ::AsyncRead;
276
- //! # use tokio_io ::codec::length_delimited;
277
+ //! # extern crate tokio ;
278
+ //! # use tokio::io ::AsyncRead;
279
+ //! # use tokio ::codec::length_delimited;
277
280
//! # fn bind_read<T: AsyncRead>(io: T) {
278
281
//! length_delimited::Builder::new()
279
282
//! .length_field_offset(0) // default value
@@ -282,6 +285,7 @@ pub mod codec {
282
285
//! .num_skip(0)
283
286
//! .new_read(io);
284
287
//! # }
288
+ //! # pub fn main() {}
285
289
//! ```
286
290
//!
287
291
//! The following frame will be decoded as such:
@@ -305,9 +309,9 @@ pub mod codec {
305
309
//! frame head, including the frame head in the yielded `BytesMut`.
306
310
//!
307
311
//! ```
308
- //! # extern crate tokio_io ;
309
- //! # use tokio_io ::AsyncRead;
310
- //! # use tokio_io ::codec::length_delimited;
312
+ //! # extern crate tokio ;
313
+ //! # use tokio::io ::AsyncRead;
314
+ //! # use tokio ::codec::length_delimited;
311
315
//! # fn bind_read<T: AsyncRead>(io: T) {
312
316
//! length_delimited::Builder::new()
313
317
//! .length_field_offset(0) // default value
@@ -316,6 +320,7 @@ pub mod codec {
316
320
//! .num_skip(0)
317
321
//! .new_read(io);
318
322
//! # }
323
+ //! # pub fn main() {}
319
324
//! ```
320
325
//!
321
326
//! The following frame will be decoded as such:
@@ -349,9 +354,9 @@ pub mod codec {
349
354
//! included.
350
355
//!
351
356
//! ```
352
- //! # extern crate tokio_io ;
353
- //! # use tokio_io ::AsyncRead;
354
- //! # use tokio_io ::codec::length_delimited;
357
+ //! # extern crate tokio ;
358
+ //! # use tokio::io ::AsyncRead;
359
+ //! # use tokio ::codec::length_delimited;
355
360
//! # fn bind_read<T: AsyncRead>(io: T) {
356
361
//! length_delimited::Builder::new()
357
362
//! .length_field_offset(1) // length of hdr1
@@ -360,6 +365,7 @@ pub mod codec {
360
365
//! .num_skip(3) // length of hdr1 + LEN
361
366
//! .new_read(io);
362
367
//! # }
368
+ //! # pub fn main() {}
363
369
//! ```
364
370
//!
365
371
//! The following frame will be decoded as such:
@@ -395,9 +401,9 @@ pub mod codec {
395
401
//! length.
396
402
//!
397
403
//! ```
398
- //! # extern crate tokio_io ;
399
- //! # use tokio_io ::AsyncRead;
400
- //! # use tokio_io ::codec::length_delimited;
404
+ //! # extern crate tokio ;
405
+ //! # use tokio::io ::AsyncRead;
406
+ //! # use tokio ::codec::length_delimited;
401
407
//! # fn bind_read<T: AsyncRead>(io: T) {
402
408
//! length_delimited::Builder::new()
403
409
//! .length_field_offset(1) // length of hdr1
@@ -406,6 +412,7 @@ pub mod codec {
406
412
//! .num_skip(3)
407
413
//! .new_read(io);
408
414
//! # }
415
+ //! # pub fn main() {}
409
416
//! ```
410
417
//!
411
418
//! The following frame will be decoded as such:
@@ -441,10 +448,10 @@ pub mod codec {
441
448
//! configuration:
442
449
//!
443
450
//! ```
444
- //! # extern crate tokio_io ;
451
+ //! # extern crate tokio ;
445
452
//! # extern crate bytes;
446
- //! # use tokio_io ::AsyncWrite;
447
- //! # use tokio_io ::codec::length_delimited;
453
+ //! # use tokio::io ::AsyncWrite;
454
+ //! # use tokio ::codec::length_delimited;
448
455
//! # use bytes::BytesMut;
449
456
//! # fn write_frame<T: AsyncWrite>(io: T) {
450
457
//! # let _: length_delimited::FramedWrite<T, BytesMut> =
0 commit comments