From 41243ae04f6aedb8a6818550668db1517d199c64 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 14 Jan 2019 22:08:13 -0800 Subject: [PATCH] Little doc cleanup --- tokio-postgres/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tokio-postgres/src/lib.rs b/tokio-postgres/src/lib.rs index 0019337e..d600b74a 100644 --- a/tokio-postgres/src/lib.rs +++ b/tokio-postgres/src/lib.rs @@ -75,7 +75,18 @@ //! the connection to work concurrently when possible. //! //! Pipelining happens automatically when futures are polled concurrently (for example, by using the futures `join` -//! combinator). Say we want to prepare 2 statements. +//! combinator): +//! +//! ```rust +//! use futures::Future; +//! use tokio_postgres::{Client, Error, Statement}; +//! +//! fn pipelined_prepare(client: &mut Client) -> impl Future +//! { +//! client.prepare("SELECT * FROM foo") +//! .join(client.prepare("INSERT INTO bar (id, name) VALUES ($1, $2)")) +//! } +//! ``` //! //! # Runtime //!