@@ -76,20 +76,23 @@ pub type PushUpdateReference<'a> = dyn FnMut(&str, Option<&str>) -> Result<(), E
76
76
/// Callback for push transfer progress
77
77
///
78
78
/// Parameters:
79
- /// * current
80
- /// * total
81
- /// * bytes
79
+ /// * current
80
+ /// * total
81
+ /// * bytes
82
82
pub type PushTransferProgress < ' a > = dyn FnMut ( usize , usize , usize ) + ' a ;
83
83
84
84
/// Callback for pack progress
85
85
///
86
+ /// Be aware that this is called inline with pack building operations,
87
+ /// so performance may be affected.
88
+ ///
86
89
/// Parameters:
87
- /// * stage
88
- /// * current
89
- /// * total
90
+ /// * stage
91
+ /// * current
92
+ /// * total
90
93
pub type PackProgress < ' a > = dyn FnMut ( PackBuilderStage , usize , usize ) + ' a ;
91
94
92
- /// Callback used to inform of upcoming updates .
95
+ /// The callback is called once between the negotiation step and the upload .
93
96
///
94
97
/// The argument is a slice containing the updates which will be sent as
95
98
/// commands to the destination.
@@ -204,6 +207,11 @@ impl<'a> RemoteCallbacks<'a> {
204
207
}
205
208
206
209
/// The callback through which progress of push transfer is monitored
210
+ ///
211
+ /// Parameters:
212
+ /// * current
213
+ /// * total
214
+ /// * bytes
207
215
pub fn push_transfer_progress < F > ( & mut self , cb : F ) -> & mut RemoteCallbacks < ' a >
208
216
where
209
217
F : FnMut ( usize , usize , usize ) + ' a ,
@@ -213,8 +221,14 @@ impl<'a> RemoteCallbacks<'a> {
213
221
}
214
222
215
223
/// Function to call with progress information during pack building.
224
+ ///
216
225
/// Be aware that this is called inline with pack building operations,
217
226
/// so performance may be affected.
227
+ ///
228
+ /// Parameters:
229
+ /// * stage
230
+ /// * current
231
+ /// * total
218
232
pub fn pack_progress < F > ( & mut self , cb : F ) -> & mut RemoteCallbacks < ' a >
219
233
where
220
234
F : FnMut ( PackBuilderStage , usize , usize ) + ' a ,
@@ -224,7 +238,11 @@ impl<'a> RemoteCallbacks<'a> {
224
238
}
225
239
226
240
/// The callback is called once between the negotiation step and the upload.
227
- /// It provides information about what updates will be performed.
241
+ ///
242
+ /// The argument to the callback is a slice containing the updates which
243
+ /// will be sent as commands to the destination.
244
+ ///
245
+ /// The push is cancelled if the callback returns an error.
228
246
pub fn push_negotiation < F > ( & mut self , cb : F ) -> & mut RemoteCallbacks < ' a >
229
247
where
230
248
F : FnMut ( & [ PushUpdate < ' _ > ] ) -> Result < ( ) , Error > + ' a ,
0 commit comments