@@ -128,7 +128,7 @@ impl<'a, Session, T> Aggregate<'a, Session, T> {
128
128
) ;
129
129
}
130
130
131
- impl < ' a > Aggregate < ' a , ImplicitSession > {
131
+ impl < ' a , T > Aggregate < ' a , ImplicitSession , T > {
132
132
/// Use the provided session when running the operation.
133
133
pub fn session (
134
134
self ,
@@ -144,7 +144,7 @@ impl<'a> Aggregate<'a, ImplicitSession> {
144
144
}
145
145
}
146
146
147
- impl < ' a , Session > Aggregate < ' a , Session , Document > {
147
+ impl < ' a , Session , T > Aggregate < ' a , Session , T > {
148
148
/// Use the provided type for the returned cursor.
149
149
///
150
150
/// ```rust
@@ -167,7 +167,7 @@ impl<'a, Session> Aggregate<'a, Session, Document> {
167
167
/// # Ok(())
168
168
/// # }
169
169
/// ```
170
- pub fn with_type < T > ( self ) -> Aggregate < ' a , Session , T > {
170
+ pub fn with_type < U > ( self ) -> Aggregate < ' a , Session , U > {
171
171
Aggregate {
172
172
target : self . target ,
173
173
pipeline : self . pipeline ,
@@ -199,11 +199,11 @@ impl<'a, T> Action for Aggregate<'a, ImplicitSession, T> {
199
199
}
200
200
}
201
201
202
- #[ action_impl( sync = crate :: sync:: SessionCursor <Document >) ]
203
- impl < ' a > Action for Aggregate < ' a , ExplicitSession < ' a > > {
202
+ #[ action_impl( sync = crate :: sync:: SessionCursor <T >) ]
203
+ impl < ' a , T > Action for Aggregate < ' a , ExplicitSession < ' a > , T > {
204
204
type Future = AggregateSessionFuture ;
205
205
206
- async fn execute ( mut self ) -> Result < SessionCursor < Document > > {
206
+ async fn execute ( mut self ) -> Result < SessionCursor < T > > {
207
207
resolve_read_concern_with_session ! ( self . target, self . options, Some ( & mut * self . session. 0 ) ) ?;
208
208
resolve_write_concern_with_session ! ( self . target, self . options, Some ( & mut * self . session. 0 ) ) ?;
209
209
resolve_selection_criteria_with_session ! (
@@ -218,8 +218,9 @@ impl<'a> Action for Aggregate<'a, ExplicitSession<'a>> {
218
218
self . options ,
219
219
) ;
220
220
let client = self . target . client ( ) ;
221
+ let session = self . session ;
221
222
client
222
- . execute_session_cursor_operation ( aggregate, self . session . 0 )
223
+ . execute_session_cursor_operation ( aggregate, session. 0 )
223
224
. await
224
225
}
225
226
}
0 commit comments