You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/sync_connection_wrapper/mod.rs
+47-38Lines changed: 47 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,56 @@ pub trait SpawnBlocking {
32
32
fnget_runtime() -> Self;
33
33
}
34
34
35
+
/// A wrapper of a [`diesel::connection::Connection`] usable in async context.
36
+
///
37
+
/// It implements AsyncConnection if [`diesel::connection::Connection`] fullfils requirements:
38
+
/// * it's a [`diesel::connection::LoadConnection`]
39
+
/// * its [`diesel::connection::Connection::Backend`] has a [`diesel::query_builder::BindCollector`] implementing [`diesel::query_builder::MoveableBindCollector`]
40
+
/// * its [`diesel::connection::LoadConnection::Row`] implements [`diesel::row::IntoOwnedRow`]
41
+
///
42
+
/// Internally this wrapper type will use `spawn_blocking` on tokio
43
+
/// to execute the request on the inner connection. This implies a
44
+
/// dependency on tokio and that the runtime is running.
45
+
///
46
+
/// Note that only SQLite is supported at the moment.
/// A wrapper of a [`diesel::connection::Connection`] usable in async context.
77
+
///
78
+
/// It implements AsyncConnection if [`diesel::connection::Connection`] fullfils requirements:
79
+
/// * it's a [`diesel::connection::LoadConnection`]
80
+
/// * its [`diesel::connection::Connection::Backend`] has a [`diesel::query_builder::BindCollector`] implementing [`diesel::query_builder::MoveableBindCollector`]
81
+
/// * its [`diesel::connection::LoadConnection::Row`] implements [`diesel::row::IntoOwnedRow`]
82
+
///
83
+
/// Internally this wrapper type will use `spawn_blocking` on given type implementing [`SpawnBlocking`] trait
84
+
/// to execute the request on the inner connection.
/// A wrapper of a [`diesel::connection::Connection`] usable in async context.
70
-
///
71
-
/// It implements AsyncConnection if [`diesel::connection::Connection`] fullfils requirements:
72
-
/// * it's a [`diesel::connection::LoadConnection`]
73
-
/// * its [`diesel::connection::Connection::Backend`] has a [`diesel::query_builder::BindCollector`] implementing [`diesel::query_builder::MoveableBindCollector`]
74
-
/// * its [`diesel::connection::LoadConnection::Row`] implements [`diesel::row::IntoOwnedRow`]
75
-
///
76
-
/// Internally this wrapper type will use `spawn_blocking` on tokio
77
-
/// to execute the request on the inner connection. This implies a
78
-
/// dependency on tokio and that the runtime is running.
79
-
///
80
-
/// Note that only SQLite is supported at the moment.
0 commit comments