Skip to main content

SearchCapable

Trait SearchCapable 

Source
pub trait SearchCapable: FileSystem {
    // Required method
    fn search_provider(&self, path: &Path) -> Option<Box<dyn SearchProvider>>;
}
Expand description

Optional trait for filesystems that support indexed search.

Builtins check for this via FileSystem::as_search_capable and use it when available. Not implementing this trait has zero cost — builtins fall back to linear file enumeration.

SearchCapable is a supertrait of FileSystem, meaning any type implementing SearchCapable must also implement FileSystem.

Required Methods§

Source

fn search_provider(&self, path: &Path) -> Option<Box<dyn SearchProvider>>

Returns a search provider scoped to the given path. Returns None if no index covers this path.

Implementors§