Skip to main content

local_sync_state

Function local_sync_state 

Source
pub fn local_sync_state(idx: &ShardedSyncIndex, path: &Path) -> u32
Expand description

Decide the sync-state badge for a local asset.

Takes a borrowed &SyncIndex rather than &AppContext because callers like asset_objects_from_state already hold the sync_index mutex guard while iterating assets. Re-acquiring it inside this function would deadlock against the outer guard (parking_lot::Mutex is non-reentrant). Returns 2 when the file’s path is recorded as synced (badge “Both”), 1 otherwise (LocalOnly).