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

Method hold_span

atomic-repository/src/changestore/mod.rs:499–504  ·  view source on GitHub ↗

Hold `bytes` as `hash`'s content at `start..start + bytes.len()`.

(&self, hash: Hash, start: u64, bytes: Vec<u8>)

Source from the content-addressed store, hash-verified

497
498 /// Hold `bytes` as `hash`'s content at `start..start + bytes.len()`.
499 pub fn hold_span(&self, hash: Hash, start: u64, bytes: Vec<u8>) {
500 if let Ok(mut spans) = self.spans.write() {
501 let end = start + bytes.len() as u64;
502 spans.spans.insert((hash, start), (end, bytes));
503 }
504 }
505
506 /// Drop every held span.
507 pub fn clear_spans(&self) {

Callers 1

import_sandbox_sliceMethod · 0.80

Calls 3

writeMethod · 0.45
lenMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected