Debian Codegraph @

src/pool/executor.rs

raw symbols SCIP
1 use eitherrust-analyzer cargo either 1.18.0 crate/::Eitherrust-analyzer cargo either 1.18.0 Either#;
2 use futures_corerust-analyzer cargo futures-core 0.3.34 crate/::futurerust-analyzer cargo futures-core 0.3.34 future/::BoxFuturerust-analyzer cargo futures-core 0.3.34 future/BoxFuture#;
3 use futures_corerust-analyzer cargo futures-core 0.3.34 crate/::streamrust-analyzer cargo futures-core 0.3.34 stream/::BoxStreamrust-analyzer cargo futures-core 0.3.34 stream/BoxStream#;
4 use futures_utilrust-analyzer cargo futures-util 0.3.34 crate/::TryStreamExtrust-analyzer cargo futures-util 0.3.34 stream/try_stream/TryStreamExt#;
5
6 use craterust-analyzer cargo sqlx-core 0.8.3 crate/::databaserust-analyzer cargo sqlx-core 0.8.3 database/::Databaserust-analyzer cargo sqlx-core 0.8.3 database/Database#;
7 use craterust-analyzer cargo sqlx-core 0.8.3 crate/::describerust-analyzer cargo sqlx-core 0.8.3 describe/::Describerust-analyzer cargo sqlx-core 0.8.3 describe/Describe#;
8 use craterust-analyzer cargo sqlx-core 0.8.3 crate/::errorrust-analyzer cargo sqlx-core 0.8.3 error/::Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#;
9 use craterust-analyzer cargo sqlx-core 0.8.3 crate/::executorrust-analyzer cargo sqlx-core 0.8.3 executor/::{Executerust-analyzer cargo sqlx-core 0.8.3 executor/Execute#, Executorrust-analyzer cargo sqlx-core 0.8.3 executor/Executor#};
10 use craterust-analyzer cargo sqlx-core 0.8.3 crate/::poolrust-analyzer cargo sqlx-core 0.8.3 pool/::Poolrust-analyzer cargo sqlx-core 0.8.3 pool/Pool#;
11
12 impl<'p, DB: Databaserust-analyzer cargo sqlx-core 0.8.3 database/Database#> Executorrust-analyzer cargo sqlx-core 0.8.3 executor/Executor#<'p> for &'_ Poolrust-analyzer cargo sqlx-core 0.8.3 pool/Pool#<DB>
13 where
14 for<'c> &'c mut DB::Connectionrust-analyzer cargo sqlx-core 0.8.3 database/Database#Connection#: Executorrust-analyzer cargo sqlx-core 0.8.3 executor/Executor#<'c, Databaserust-analyzer cargo sqlx-core 0.8.3 executor/Executor#Database# = DB>,
15 {
16 type Databaserust-analyzer cargo sqlx-core 0.8.3 pool/executor/impl#[`&Pool<DB>`][`Executor<'p>`]Database# = DB;
17
18 fn fetch_manyrust-analyzer cargo sqlx-core 0.8.3 pool/executor/impl#[`&Pool<DB>`][`Executor<'p>`]fetch_many().<'e, 'q: 'e, E>(
19 self,
20 query: E,
21 ) -> BoxStreamrust-analyzer cargo futures-core 0.3.34 stream/BoxStream#<'e, Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Eitherrust-analyzer cargo either 1.18.0 Either#<DB::QueryResultrust-analyzer cargo sqlx-core 0.8.3 database/Database#QueryResult#, DB::Rowrust-analyzer cargo sqlx-core 0.8.3 database/Database#Row#>, Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#>>
22 where
23 E: 'q + Executerust-analyzer cargo sqlx-core 0.8.3 executor/Execute#<'q, Selfrust-analyzer cargo sqlx-core 0.8.3 pool/executor/impl#[`&Pool<DB>`][`Executor<'p>`]::Databaserust-analyzer cargo sqlx-core 0.8.3 executor/Executor#Database#>,
24 {
25 let pool = self.clonerust-analyzer cargo sqlx-core 0.8.3 pool/impl#[`Pool<DB>`][Clone]clone().();
26
27 Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::pinrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]pin().(try_streamrust-analyzer cargo sqlx-core 0.8.3 ext/async_stream/try_stream!! {
28 let mut conn = pool.acquirerust-analyzer cargo sqlx-core 0.8.3 pool/impl#[`Pool<DB>`]acquire().().rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
29 let mut s = conn.fetch_manyrust-analyzer cargo sqlx-core 0.8.3 executor/Executor#fetch_many().(query);
30
31 while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(v) = s.try_nextrust-analyzer cargo futures-util 0.3.34 stream/try_stream/TryStreamExt#try_next().().rust-analyzer cargo futures-util 0.3.34 stream/try_stream/try_next/impl#[`TryNext<'_, St>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 stream/try_stream/try_next/impl#[`TryNext<'_, St>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). {
32 r#yieldrust-analyzer cargo sqlx-core 0.8.3 pool/executor/`r#yield`!!(v);
33 }
34
35 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
36 })
37 }
38
39 fn fetch_optionalrust-analyzer cargo sqlx-core 0.8.3 pool/executor/impl#[`&Pool<DB>`][`Executor<'p>`]fetch_optional().<'e, 'q: 'e, E>(
40 self,
41 query: E,
42 ) -> BoxFuturerust-analyzer cargo futures-core 0.3.34 future/BoxFuture#<'e, Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<DB::Rowrust-analyzer cargo sqlx-core 0.8.3 database/Database#Row#>, Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#>>
43 where
44 E: 'q + Executerust-analyzer cargo sqlx-core 0.8.3 executor/Execute#<'q, Selfrust-analyzer cargo sqlx-core 0.8.3 pool/executor/impl#[`&Pool<DB>`][`Executor<'p>`]::Databaserust-analyzer cargo sqlx-core 0.8.3 executor/Executor#Database#>,
45 {
46 let pool = self.clonerust-analyzer cargo sqlx-core 0.8.3 pool/impl#[`Pool<DB>`][Clone]clone().();
47
48 Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::pinrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]pin().(async move { pool.acquirerust-analyzer cargo sqlx-core 0.8.3 pool/impl#[`Pool<DB>`]acquire().().rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..fetch_optionalrust-analyzer cargo sqlx-core 0.8.3 executor/Executor#fetch_optional().(query).rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/impl#[`Pin<P>`][Future]poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/impl#[`Pin<P>`][Future]poll(). })
49 }
50
51 fn prepare_withrust-analyzer cargo sqlx-core 0.8.3 pool/executor/impl#[`&Pool<DB>`][`Executor<'p>`]prepare_with().<'e, 'q: 'e>(
52 self,
53 sql: &'q str,
54 parameters: &'e [<Selfrust-analyzer cargo sqlx-core 0.8.3 pool/executor/impl#[`&Pool<DB>`][`Executor<'p>`]::Databaserust-analyzer cargo sqlx-core 0.8.3 executor/Executor#Database# as Databaserust-analyzer cargo sqlx-core 0.8.3 database/Database#>::TypeInforust-analyzer cargo sqlx-core 0.8.3 database/Database#TypeInfo#],
55 ) -> BoxFuturerust-analyzer cargo futures-core 0.3.34 future/BoxFuture#<'e, Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<<Selfrust-analyzer cargo sqlx-core 0.8.3 pool/executor/impl#[`&Pool<DB>`][`Executor<'p>`]::Databaserust-analyzer cargo sqlx-core 0.8.3 executor/Executor#Database# as Databaserust-analyzer cargo sqlx-core 0.8.3 database/Database#>::Statementrust-analyzer cargo sqlx-core 0.8.3 database/Database#Statement#<'q>, Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#>> {
56 let pool = self.clonerust-analyzer cargo sqlx-core 0.8.3 pool/impl#[`Pool<DB>`][Clone]clone().();
57
58 Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::pinrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]pin().(async move { pool.acquirerust-analyzer cargo sqlx-core 0.8.3 pool/impl#[`Pool<DB>`]acquire().().rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..prepare_withrust-analyzer cargo sqlx-core 0.8.3 executor/Executor#prepare_with().(sql, parameters).rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/impl#[`Pin<P>`][Future]poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/impl#[`Pin<P>`][Future]poll(). })
59 }
60
61 #[doc(hidden)]
62 fn describerust-analyzer cargo sqlx-core 0.8.3 pool/executor/impl#[`&Pool<DB>`][`Executor<'p>`]describe().<'e, 'q: 'e>(
63 self,
64 sql: &'q str,
65 ) -> BoxFuturerust-analyzer cargo futures-core 0.3.34 future/BoxFuture#<'e, Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Describerust-analyzer cargo sqlx-core 0.8.3 describe/Describe#<Selfrust-analyzer cargo sqlx-core 0.8.3 pool/executor/impl#[`&Pool<DB>`][`Executor<'p>`]::Databaserust-analyzer cargo sqlx-core 0.8.3 executor/Executor#Database#>, Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#>> {
66 let pool = self.clonerust-analyzer cargo sqlx-core 0.8.3 pool/impl#[`Pool<DB>`][Clone]clone().();
67
68 Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::pinrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]pin().(async move { pool.acquirerust-analyzer cargo sqlx-core 0.8.3 pool/impl#[`Pool<DB>`]acquire().().rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..describerust-analyzer cargo sqlx-core 0.8.3 executor/Executor#describe().(sql).rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/impl#[`Pin<P>`][Future]poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/impl#[`Pin<P>`][Future]poll(). })
69 }
70 }
71
72 // Causes an overflow when evaluating `&mut DB::Connection: Executor`.
73 //
74 //
75 // impl<'c, DB: Database> crate::executor::Executor<'c> for &'c mut crate::pool::PoolConnection<DB>
76 // where
77 // &'c mut DB::Connection: Executor<'c, Database = DB>,
78 // {
79 // type Database = DB;
80 //
81 //
82 //
83 // #[inline]
84 // fn fetch_many<'e, 'q: 'e, E: 'q>(
85 // self,
86 // query: E,
87 // ) -> futures_core::stream::BoxStream<
88 // 'e,
89 // Result<
90 // either::Either<<DB as crate::database::Database>::QueryResult, DB::Row>,
91 // crate::error::Error,
92 // >,
93 // >
94 // where
95 // 'c: 'e,
96 // E: crate::executor::Execute<'q, DB>,
97 // {
98 // (**self).fetch_many(query)
99 // }
100 //
101 // #[inline]
102 // fn fetch_optional<'e, 'q: 'e, E: 'q>(
103 // self,
104 // query: E,
105 // ) -> futures_core::future::BoxFuture<'e, Result<Option<DB::Row>, crate::error::Error>>
106 // where
107 // 'c: 'e,
108 // E: crate::executor::Execute<'q, DB>,
109 // {
110 // (**self).fetch_optional(query)
111 // }
112 //
113 // #[inline]
114 // fn prepare_with<'e, 'q: 'e>(
115 // self,
116 // sql: &'q str,
117 // parameters: &'e [<DB as crate::database::Database>::TypeInfo],
118 // ) -> futures_core::future::BoxFuture<
119 // 'e,
120 // Result<<DB as crate::database::Database>::Statement<'q>, crate::error::Error>,
121 // >
122 // where
123 // 'c: 'e,
124 // {
125 // (**self).prepare_with(sql, parameters)
126 // }
127 //
128 // #[doc(hidden)]
129 // #[inline]
130 // fn describe<'e, 'q: 'e>(
131 // self,
132 // sql: &'q str,
133 // ) -> futures_core::future::BoxFuture<
134 // 'e,
135 // Result<crate::describe::Describe<DB>, crate::error::Error>,
136 // >
137 // where
138 // 'c: 'e,
139 // {
140 // (**self).describe(sql)
141 // }
142 // }