Function dochy::fs::history::save_history_file_nb[][src]

pub fn save_history_file_nb<F>(
    history_info: &HistoryInfo,
    tag: Option<String>,
    root: &RootObject,
    callback: F
) where
    F: 'static + FnOnce(Result<FileNameProps, FsError>) + Send
Expand description

calculates the diff from the latest save file(most of the time) and save the diff file. This is non-blocking. RootObject is cloned and saved. RootObject consists of some Arcs so the cloning costs nearly zero. This system employs Copy on Write strategy. Actual copy occurs when the memory managed by Arc is modified before the saving is finished using Arc::make_mut.

The saving process is synchronized. You can call this function multiple times and the save is processed one by one.