MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / file

Method file

atomic-core/src/pristine/span_patch_storage.rs:521–538  ·  view source on GitHub ↗
(
        &mut self,
        txn: &T,
        file: &ExternalFile,
        metrics: &mut SpanContextBuildMetrics,
    )

Source from the content-addressed store, hash-verified

519 }
520
521 fn file<T: SpanPatchReadTxn>(
522 &mut self,
523 txn: &T,
524 file: &ExternalFile,
525 metrics: &mut SpanContextBuildMetrics,
526 ) -> Result<Inode> {
527 let key = (file.owner, file.ordinal);
528 if let Some(inode) = self.files.get(&key) {
529 metrics.file_hits += 1;
530 return Ok(*inode);
531 }
532 metrics.file_lookups += 1;
533 let inode = txn
534 .span_file_inode(file)?
535 .context("span file mapping missing")?;
536 self.files.insert(key, inode);
537 Ok(inode)
538 }
539}
540
541// Transaction-local exact reachability; never use local NodeId ordering as

Callers 1

Calls 4

getMethod · 0.65
contextMethod · 0.45
span_file_inodeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected