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

Function projection_ids

atomic-core/src/pristine/span_patch_storage.rs:2388–2417  ·  view source on GitHub ↗
(
            repo: &Pristine,
            store: &MemoryChangeStore,
            view_name: &str,
            inode: Inode,
        )

Source from the content-addressed store, hash-verified

2386 Vec<(SpanProjectionId, Vec<SpanProjectionId>)>,
2387 );
2388 fn projection_ids(
2389 repo: &Pristine,
2390 store: &MemoryChangeStore,
2391 view_name: &str,
2392 inode: Inode,
2393 ) -> Result<ProjectionIds> {
2394 let txn = repo.read_txn()?;
2395 let view = txn.get_view(view_name)?.context("view missing")?;
2396 let visible = EffectiveProjectionClosure::try_from_membership(
2397 &txn,
2398 &txn.view_membership_set(&view)?,
2399 )?;
2400 let state = SpanRenderContext::new(&txn, store, &visible)?
2401 .record_state(inode)?
2402 .context("span state missing")?;
2403 let snapshot = state.semantic_snapshot()?;
2404 Ok((
2405 snapshot.id,
2406 snapshot
2407 .lines
2408 .into_iter()
2409 .map(|line| {
2410 (
2411 line.id,
2412 line.tokens.into_iter().map(|token| token.id).collect(),
2413 )
2414 })
2415 .collect(),
2416 ))
2417 }
2418 let dir = tempfile::tempdir()?;
2419 let path = dir.path().join("pristine.redb");
2420 let repo = Pristine::open(&path)?;

Calls 8

read_txnMethod · 0.80
view_membership_setMethod · 0.80
record_stateMethod · 0.80
semantic_snapshotMethod · 0.80
contextMethod · 0.45
get_viewMethod · 0.45
collectMethod · 0.45
into_iterMethod · 0.45