mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-31 05:44:25 +01:00
wip
This commit is contained in:
@@ -241,6 +241,10 @@ impl ProtocolIO for JsProtocolIo {
|
||||
.collect(),
|
||||
}))
|
||||
}
|
||||
|
||||
fn register(&self, callback: Box<dyn FnMut() -> bool>) {
|
||||
tracing::info!("register callback in the ProtocolIo");
|
||||
}
|
||||
}
|
||||
|
||||
#[napi]
|
||||
|
||||
@@ -119,6 +119,7 @@ pub struct SyncEngineOpts {
|
||||
pub protocol_version: Option<SyncEngineProtocolVersion>,
|
||||
pub bootstrap_if_empty: bool,
|
||||
pub remote_encryption: Option<String>,
|
||||
pub partial: Option<bool>,
|
||||
}
|
||||
|
||||
struct SyncEngineOptsFilled {
|
||||
@@ -131,6 +132,7 @@ struct SyncEngineOptsFilled {
|
||||
pub protocol_version: DatabaseSyncEngineProtocolVersion,
|
||||
pub bootstrap_if_empty: bool,
|
||||
pub remote_encryption: Option<CipherMode>,
|
||||
pub partial: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
@@ -224,6 +226,7 @@ impl SyncEngine {
|
||||
))
|
||||
}
|
||||
},
|
||||
partial: opts.partial.unwrap_or(false),
|
||||
};
|
||||
Ok(SyncEngine {
|
||||
opts: opts_filled,
|
||||
@@ -251,6 +254,7 @@ impl SyncEngine {
|
||||
.remote_encryption
|
||||
.map(|x| x.required_metadata_size())
|
||||
.unwrap_or(0),
|
||||
partial: self.opts.partial,
|
||||
};
|
||||
|
||||
let io = self.io()?;
|
||||
|
||||
@@ -12,7 +12,6 @@ pub trait DataCompletion<T> {
|
||||
fn status(&self) -> Result<Option<u16>>;
|
||||
fn poll_data(&self) -> Result<Option<Self::DataPollResult>>;
|
||||
fn is_done(&self) -> Result<bool>;
|
||||
fn set_callback(&self, callback: Box<dyn FnMut() -> ()>);
|
||||
}
|
||||
|
||||
pub trait ProtocolIO: Send + Sync + 'static {
|
||||
|
||||
Reference in New Issue
Block a user