Lines Matching +full:- +full:- +full:progress
3 //! To create a [`Backup`], you must have two distinct [`Connection`]s - one
7 //! [`progress`](Backup::progress) gets the current progress of the backup as of
25 //! progress: fn(backup::Progress),
26 //! ) -> Result<()> {
29 //! backup.run_to_completion(5, time::Duration::from_millis(250), Some(progress))
50 /// If `progress` is not `None`, it will be called periodically
53 /// For more fine-grained control over the backup process (e.g.,
55 /// already-open database connection), see the `backup` module.
65 progress: Option<fn(Progress)>, in backup() argument
66 ) -> Result<()> { in backup()
74 if let Some(f) = progress { in backup()
75 f(backup.progress()); in backup()
88 /// `name` database. If `progress` is not `None`, it will be
91 /// For more fine-grained control over the restore process (e.g.,
93 /// already-open database connection), see the `backup` module.
99 pub fn restore<P: AsRef<Path>, F: Fn(Progress)>( in restore()
103 progress: Option<F>, in restore()
104 ) -> Result<()> { in restore()
113 if let Some(ref f) = progress { in restore()
114 f(restore.progress()); in restore()
147 /// not a fatal error - the step can be retried.
151 /// database. This is not a fatal error - the step can be retried.
155 /// Struct specifying the progress of a backup. The
156 /// percentage completion can be calculated as `(pagecount - remaining) /
157 /// pagecount`. The progress of a backup is as of the last call to
158 /// [`step`](Backup::step) - if the source database is modified after a call to
159 /// [`step`](Backup::step), the progress value will become outdated and
162 pub struct Progress { struct
178 /// `to`. Note that `to` is a `&mut` - this is because SQLite forbids any
187 pub fn new<'a, 'b>(from: &'a Connection, to: &'b mut Connection) -> Result<Backup<'a, 'b>> { in new()
193 /// that `to` is a `&mut` - this is because SQLite forbids any API calls on
205 ) -> Result<Backup<'a, 'b>> { in new_with_names()
231 /// Gets the progress of the backup as of the last call to
235 pub fn progress(&self) -> Progress { in progress() argument
237 Progress { in progress()
258 pub fn step(&self, num_pages: c_int) -> Result<StepResult> { in step()
278 /// If `progress` is not `None`, it will be called after each step with the
279 /// current progress of the backup. Note that is possible the progress may
291 progress: Option<fn(Progress)>, in run_to_completion() argument
292 ) -> Result<()> { in run_to_completion()
299 if let Some(progress) = progress { in run_to_completion()
300 progress(self.progress()); in run_to_completion()
324 fn test_backup() -> Result<()> { in test_backup()
336 backup.step(-1)?; in test_backup()
355 fn test_backup_temp() -> Result<()> { in test_backup_temp()
368 backup.step(-1)?; in test_backup_temp()
388 fn test_backup_attached() -> Result<()> { in test_backup_attached()
406 backup.step(-1)?; in test_backup_attached()