-
Notifications
You must be signed in to change notification settings - Fork 486
Expand file tree
/
Copy pathmod.rs
More file actions
30 lines (22 loc) · 821 Bytes
/
mod.rs
File metadata and controls
30 lines (22 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use std::future::Future;
use super::rpc::replication::Frame as RpcFrame;
pub use sqlite_injector::SqliteInjector;
use crate::frame::FrameNo;
pub use error::Error;
use error::Result;
mod error;
mod sqlite_injector;
pub trait Injector {
/// Inject a singular frame.
fn inject_frame(
&mut self,
frame: RpcFrame,
) -> impl Future<Output = Result<Option<FrameNo>>> + Send;
/// Discard any uncommintted frames.
fn rollback(&mut self) -> impl Future<Output = ()> + Send;
/// Flush the buffer to libsql WAL.
/// Trigger a dummy write, and flush the cache to trigger a call to xFrame. The buffer's frame
/// are then injected into the wal.
fn flush(&mut self) -> impl Future<Output = Result<Option<FrameNo>>> + Send;
fn durable_frame_no(&mut self, frame_no: u64);
}