We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0707887 commit 41243aeCopy full SHA for 41243ae
tokio-postgres/src/lib.rs
@@ -75,7 +75,18 @@
75
//! the connection to work concurrently when possible.
76
//!
77
//! Pipelining happens automatically when futures are polled concurrently (for example, by using the futures `join`
78
-//! combinator). Say we want to prepare 2 statements.
+//! 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
+//! ```
90
91
//! # Runtime
92
0 commit comments