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

Method fetch_token_index

backend/src/git/client.rs:270–284  ·  view source on GitHub ↗
(
        &self,
        repo_id: RepoId,
        filename: &PathBuf,
    )

Source from the content-addressed store, hash-verified

268 }
269
270 pub fn fetch_token_index(
271 &self,
272 repo_id: RepoId,
273 filename: &PathBuf,
274 ) -> Result<SearchTokenIndex> {
275 let view = self.view(repo_id)?;
276 let result = view.find_blob_by_filename(filename)?;
277 match result {
278 Some(blob) => Ok(SearchTokenIndex::make(
279 filename.to_owned(),
280 blob.try_into()?,
281 )),
282 None => Ok(SearchTokenIndex::new(filename)),
283 }
284 }
285
286 pub fn fetch_topic(&self, repo_id: RepoId, topic_id: &ExternalId) -> Option<RepoTopic> {
287 match &self.fetch(repo_id, topic_id)? {

Callers 2

search_indexMethod · 0.80
token_indexMethod · 0.80

Calls 3

find_blob_by_filenameMethod · 0.80
viewMethod · 0.45
try_intoMethod · 0.45

Tested by

no test coverage detected