MCPcopy Create free account
hub / github.com/cosdata/cosdata / file_offset

Function file_offset

src/models/buffered_io.rs:876–881  ·  view source on GitHub ↗
(region: usize, region_offset: usize)

Source from the content-addressed store, hash-verified

874 }
875
876 fn file_offset(region: usize, region_offset: usize) -> u64 {
877 if region_offset > BUFFER_SIZE {
878 panic!("region_offset must be smaller than BUFFER_SIZE ({BUFFER_SIZE})");
879 }
880 (BUFFER_SIZE * (region - 1) + region_offset) as u64
881 }
882
883 #[test]
884 fn test_reads_across_regions() {

Calls

no outgoing calls