We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7292397 commit 028ad8cCopy full SHA for 028ad8c
1 file changed
chuchi-postgres/src/db.rs
@@ -4,7 +4,12 @@
4
//! If you wan't to use axum the best way is to make a small wrapper around
5
//! ConnOwned.
6
//!
7
-//! ```rust
+//! ```ignore
8
+//! use chuchi_postgres as pg;
9
+//! use pg::db::{Conn, Trans, Db};
10
+//! use axum::extract::{FromRequestParts, FromRef};
11
+//! use axum::http::request::Parts;
12
+//!
13
//! pub struct ConnOwned(pub pg::db::ConnOwned);
14
15
//! impl ConnOwned {
@@ -22,7 +27,7 @@
22
27
//! S: Send + Sync,
23
28
//! Db: FromRef<S>,
24
29
//! {
25
-//! type Rejection = Error;
30
+//! type Rejection = MyError;
26
31
32
//! async fn from_request_parts(
33
//! _parts: &mut Parts,
@@ -32,7 +37,7 @@
37
//! db.get()
38
//! .await
34
39
//! .map(Self)
35
-//! .map_err(|e| Error::Internal(e.to_string()))
40
+//! .map_err(|e| MyError::Internal(e.to_string()))
36
41
//! }
42
43
//! ```
0 commit comments