MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / next_tx_offset

Function next_tx_offset

crates/commitlog/src/segment.rs:919–936  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

917
918 #[test]
919 fn next_tx_offset() {
920 let mut writer = Writer {
921 commit: Commit::default(),
922 inner: BufWriter::new(Vec::new()),
923
924 min_tx_offset: 0,
925 bytes_written: 0,
926
927 offset_index_head: None,
928 };
929
930 assert_eq!(0, writer.next_tx_offset());
931 writer.commit([(0, [0; 16])]).unwrap();
932 assert_eq!(1, writer.next_tx_offset());
933 writer.commit([(1, [1; 16])]).unwrap();
934 writer.commit([(2, [1; 16])]).unwrap();
935 assert_eq!(3, writer.next_tx_offset());
936 }
937
938 #[test]
939 fn offset_index_writer_truncates_to_offset() {

Callers

nothing calls this directly

Calls 3

commitMethod · 0.65
newFunction · 0.50
unwrapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…