@@ -83,13 +83,16 @@ pub type PushTransferProgress<'a> = dyn FnMut(usize, usize, usize) + 'a;
8383
8484/// Callback for pack progress
8585///
86+ /// Be aware that this is called inline with pack building operations,
87+ /// so performance may be affected.
88+ ///
8689/// Parameters:
8790/// * stage
8891/// * current
8992/// * total
9093pub type PackProgress < ' a > = dyn FnMut ( PackBuilderStage , usize , usize ) + ' a ;
9194
92- /// Callback used to inform of upcoming updates .
95+ /// The callback is called once between the negotiation step and the upload .
9396///
9497/// The argument is a slice containing the updates which will be sent as
9598/// commands to the destination.
@@ -204,6 +207,11 @@ impl<'a> RemoteCallbacks<'a> {
204207 }
205208
206209 /// The callback through which progress of push transfer is monitored
210+ ///
211+ /// Parameters:
212+ /// * current
213+ /// * total
214+ /// * bytes
207215 pub fn push_transfer_progress < F > ( & mut self , cb : F ) -> & mut RemoteCallbacks < ' a >
208216 where
209217 F : FnMut ( usize , usize , usize ) + ' a ,
@@ -213,8 +221,14 @@ impl<'a> RemoteCallbacks<'a> {
213221 }
214222
215223 /// Function to call with progress information during pack building.
224+ ///
216225 /// Be aware that this is called inline with pack building operations,
217226 /// so performance may be affected.
227+ ///
228+ /// Parameters:
229+ /// * stage
230+ /// * current
231+ /// * total
218232 pub fn pack_progress < F > ( & mut self , cb : F ) -> & mut RemoteCallbacks < ' a >
219233 where
220234 F : FnMut ( PackBuilderStage , usize , usize ) + ' a ,
@@ -224,7 +238,11 @@ impl<'a> RemoteCallbacks<'a> {
224238 }
225239
226240 /// 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.
228246 pub fn push_negotiation < F > ( & mut self , cb : F ) -> & mut RemoteCallbacks < ' a >
229247 where
230248 F : FnMut ( & [ PushUpdate < ' _ > ] ) -> Result < ( ) , Error > + ' a ,
0 commit comments