Skip to main content

start_scan

Function start_scan 

Source
pub fn start_scan(
    root_path: PathBuf,
    db: Arc<Mutex<Database>>,
    cancel: Arc<AtomicBool>,
    scan_hidden_folders: bool,
) -> (Receiver<ScanProgress>, JoinHandle<ScanReport>)
Expand description

Start a scan in a background task.

Borrows the database via Arc<Mutex<Database>> so the library stays open and queryable while the scan runs. The caller provides the cancel flag (usually job.cancel) so pause/resume is unified across all background jobs.