Skip to content

Commit 0622523

Browse files
committed
introduce swap_strategy
1 parent 2014773 commit 0622523

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

libsql-wal/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub mod shared_wal;
1010
pub mod storage;
1111
pub mod transaction;
1212
pub mod wal;
13+
mod swap_strategy;
1314

1415
const LIBSQL_MAGIC: u64 = u64::from_be_bytes(*b"LIBSQL\0\0");
1516
const LIBSQL_PAGE_SIZE: u16 = 4096;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pub(crate) mod duration;
2+
pub(crate) mod frame_count;
3+
4+
pub(crate) trait SwapStrategy: Sync + Send + 'static {
5+
fn should_swap(&self, frames_in_wal: usize) -> bool;
6+
fn swapped(&self);
7+
}

0 commit comments

Comments
 (0)