Skip to main content

ProjectSearchService

Trait ProjectSearchService 

Source
pub trait ProjectSearchService:
    Send
    + Sync
    + Debug {
    // Required methods
    fn state(&self, view: BufferId) -> Option<Arc<RwLock<ProjectSearchState>>>;
    fn set_state(&self, view: BufferId, state: ProjectSearchState);
    fn clear(&self, view: BufferId);
    fn attach_task(&self, view: BufferId, handle: JoinHandle<()>);
    fn add_hits(&self, view: BufferId, add: usize);
    fn set_status(&self, view: BufferId, status: SearchStatus);
    fn len(&self) -> usize;
    fn record_source_path(
        &self,
        view: BufferId,
        source: BufferId,
        path: PathBuf,
    );
    fn source_path(&self, view: BufferId, source: BufferId) -> Option<PathBuf>;
    fn find_source_for_path(
        &self,
        view: BufferId,
        path: &Path,
    ) -> Option<BufferId>;
}
Expand description

Per-view provider state lookup. Registered in ServiceRegistry at boot; minor mode + scan-task glue go through this trait.

Required Methods§

Source

fn state(&self, view: BufferId) -> Option<Arc<RwLock<ProjectSearchState>>>

Source

fn set_state(&self, view: BufferId, state: ProjectSearchState)

Source

fn clear(&self, view: BufferId)

Source

fn attach_task(&self, view: BufferId, handle: JoinHandle<()>)

Source

fn add_hits(&self, view: BufferId, add: usize)

Update the running tally of hits as a scan progresses.

Source

fn set_status(&self, view: BufferId, status: SearchStatus)

Source

fn len(&self) -> usize

Source

fn record_source_path(&self, view: BufferId, source: BufferId, path: PathBuf)

M.6.1: record the on-disk path for a source buffer the forwarder just attached to the view. Jump-to-source reads this map back to resolve excerpt → path.

Source

fn source_path(&self, view: BufferId, source: BufferId) -> Option<PathBuf>

M.6.1: look up the path for a source buffer (used by jump-to-source after finding the excerpt under cursor).

Source

fn find_source_for_path(&self, view: BufferId, path: &Path) -> Option<BufferId>

M.6.2 (2026-06-01): reverse lookup — find an existing source buffer for a path inside a view. Forwarder uses this to dedup file loads across batches: a file with hits split across two batches reuses the same source buffer instead of spawning a second RopeDocumentHandle.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§