MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / sync_database_with_progress

Function sync_database_with_progress

rust/src/collaboration/sync.rs:283–307  ·  view source on GitHub ↗

Completely sync a database, pushing/pulling/merging/applying changes `database` - Database to sync `file` - File to sync with `conflict_handler` - Function to call to resolve snapshot conflicts `name_changeset` - Function to call for naming a pushed changeset, if necessary `progress` - Function to call for progress updates

(
    database: &Database,
    file: &RemoteFile,
    mut conflict_handler: C,
    mut name_changeset: N,
    mut progress: P,
)

Source from the content-addressed store, hash-verified

281/// * `name_changeset` - Function to call for naming a pushed changeset, if necessary
282/// * `progress` - Function to call for progress updates
283pub fn sync_database_with_progress<
284 C: DatabaseConflictHandler,
285 P: ProgressCallback,
286 N: NameChangeset,
287>(
288 database: &Database,
289 file: &RemoteFile,
290 mut conflict_handler: C,
291 mut name_changeset: N,
292 mut progress: P,
293) -> Result<(), ()> {
294 let success = unsafe {
295 BNCollaborationSyncDatabase(
296 database.handle.as_ptr(),
297 file.handle.as_ptr(),
298 Some(C::cb_handle_conflict),
299 &mut conflict_handler as *mut C as *mut c_void,
300 Some(P::cb_progress_callback),
301 &mut progress as *mut P as *mut c_void,
302 Some(N::cb_name_changeset),
303 &mut name_changeset as *mut N as *mut c_void,
304 )
305 };
306 success.then_some(()).ok_or(())
307}
308
309/// Pull updated snapshots from the remote. Merge local changes with remote changes and
310/// potentially create a new snapshot for unsaved changes, named via name_changeset.

Callers 2

sync_with_progressMethod · 0.85
sync_databaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected