Skip to content

Commit 41243ae

Browse files
committed
Little doc cleanup
1 parent 0707887 commit 41243ae

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tokio-postgres/src/lib.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,18 @@
7575
//! the connection to work concurrently when possible.
7676
//!
7777
//! Pipelining happens automatically when futures are polled concurrently (for example, by using the futures `join`
78-
//! combinator). Say we want to prepare 2 statements.
78+
//! combinator):
79+
//!
80+
//! ```rust
81+
//! use futures::Future;
82+
//! use tokio_postgres::{Client, Error, Statement};
83+
//!
84+
//! fn pipelined_prepare(client: &mut Client) -> impl Future<Item = (Statement, Statement), Error = Error>
85+
//! {
86+
//! client.prepare("SELECT * FROM foo")
87+
//! .join(client.prepare("INSERT INTO bar (id, name) VALUES ($1, $2)"))
88+
//! }
89+
//! ```
7990
//!
8091
//! # Runtime
8192
//!

0 commit comments

Comments
 (0)