Skip to main content

resolve_dir_entry

Function resolve_dir_entry 

Source
pub async fn resolve_dir_entry(
    meta: &Arc<dyn MetaAdapter>,
    cache: &DirCache,
    tn_id: TnId,
    file_id: &str,
) -> ClResult<Option<DirEntry>>
Expand description

Resolve one (tn, file_id)DirEntry through the folder cache, falling back to a single read_file on a miss. The row is cached only when it is a folder (is_folder), keeping the cache small and folder-only; non-folder rows (e.g. the leaf that starts a descendant walk) are returned but never inserted.

Propagates read errors as Err so request-path callers can surface a genuine fault as 5xx instead of mistaking it for “missing / not a descendant”.