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

Function mapped_record_state

atomic-core/src/pristine/span_patch_storage.rs:1564–1602  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1562 use crate::pristine::{MutTxnT, Pristine, ViewScope};
1563
1564 fn mapped_record_state() -> SpanRecordState {
1565 let first = Hash::of(b"first");
1566 let second = Hash::of(b"second");
1567 let root = ExternalSpan {
1568 owner: first,
1569 start: 10,
1570 end: 20,
1571 };
1572 SpanRecordState {
1573 file: ExternalFile {
1574 owner: first,
1575 ordinal: 0,
1576 },
1577 root: root.clone(),
1578 content: b"abcDEFghi".to_vec(),
1579 spans: vec![
1580 VisibleSpan {
1581 output: 0..3,
1582 target: root.clone(),
1583 target_start: 2,
1584 },
1585 VisibleSpan {
1586 output: 3..6,
1587 target: ExternalSpan {
1588 owner: second,
1589 start: 30,
1590 end: 33,
1591 },
1592 target_start: 0,
1593 },
1594 VisibleSpan {
1595 output: 6..9,
1596 target: root,
1597 target_start: 5,
1598 },
1599 ],
1600 dependencies: vec![first, second],
1601 }
1602 }
1603
1604 #[test]
1605 fn authored_ranges_preserve_owners_across_split_lines_and_tokens() -> Result<()> {

Calls 1

cloneMethod · 0.45