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

Function projection_ids

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

Source from the content-addressed store, hash-verified

1967 #[test]
1968 fn independent_span_edits_render_in_both_insert_orders() -> Result<()> {
1969 fn projection_ids(
1970 repo: &Pristine,
1971 store: &MemoryChangeStore,
1972 view_name: &str,
1973 inode: Inode,
1974 ) -> Result<(
1975 SpanProjectionId,
1976 Vec<(SpanProjectionId, Vec<SpanProjectionId>)>,
1977 )> {
1978 let txn = repo.read_txn()?;
1979 let view = txn.get_view(view_name)?.context("view missing")?;
1980 let visible = EffectiveProjectionClosure::try_from_membership(
1981 &txn,
1982 &txn.view_membership_set(&view)?,
1983 )?;
1984 let state = SpanRenderContext::new(&txn, store, &visible)?
1985 .record_state(inode)?
1986 .context("span state missing")?;
1987 let snapshot = state.semantic_snapshot()?;
1988 Ok((
1989 snapshot.id,
1990 snapshot
1991 .lines
1992 .into_iter()
1993 .map(|line| {
1994 (
1995 line.id,
1996 line.tokens.into_iter().map(|token| token.id).collect(),
1997 )
1998 })
1999 .collect(),
2000 ))
2001 }
2002 let dir = tempfile::tempdir()?;
2003 let path = dir.path().join("pristine.redb");
2004 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