MCPcopy Create free account
hub / github.com/emwalker/digraph / search_token_prefix_matches

Method search_token_prefix_matches

backend/src/git/client.rs:335–343  ·  view source on GitHub ↗

The "prefix" argument tells us which repo to look in. The "prefix" in the method name alludes to the prefix scan that is done to find matching synonyms.

(
        &self,
        repo_id: RepoId,
        token: &Phrase,
    )

Source from the content-addressed store, hash-verified

333 // The "prefix" argument tells us which repo to look in. The "prefix" in the method name
334 // alludes to the prefix scan that is done to find matching synonyms.
335 pub fn search_token_prefix_matches(
336 &self,
337 repo_id: RepoId,
338 token: &Phrase,
339 ) -> Result<HashSet<SearchEntry>> {
340 let key = repo_id.index_key(token)?;
341 let index = key.search_index(self, IndexType::Search, IndexMode::ReadOnly)?;
342 Ok(index.prefix_matches(token))
343 }
344
345 pub fn view_stats(&self, repo_id: RepoId) -> Result<RepoStats> {
346 self.view(repo_id)?.stats()

Callers 1

fetch_matchesMethod · 0.80

Calls 3

index_keyMethod · 0.80
search_indexMethod · 0.80
prefix_matchesMethod · 0.80

Tested by

no test coverage detected