mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-29 22:14:23 +01:00
adjust sync package napi-rs code
This commit is contained in:
@@ -7,9 +7,6 @@ use std::{
|
||||
|
||||
use turso_sync_engine::types::{DbChangesStatus, ProtocolCommand};
|
||||
|
||||
pub const GENERATOR_RESUME_IO: u32 = 0;
|
||||
pub const GENERATOR_RESUME_DONE: u32 = 1;
|
||||
|
||||
pub trait Generator {
|
||||
fn resume(&mut self, result: Option<String>) -> napi::Result<GeneratorResponse>;
|
||||
}
|
||||
@@ -57,6 +54,17 @@ pub enum GeneratorResponse {
|
||||
},
|
||||
}
|
||||
|
||||
#[napi]
|
||||
impl SyncEngineChanges {
|
||||
#[napi]
|
||||
pub fn empty(&self) -> bool {
|
||||
let Some(changes) = self.status.as_ref() else {
|
||||
return true;
|
||||
};
|
||||
changes.file_slot.is_none()
|
||||
}
|
||||
}
|
||||
|
||||
#[napi]
|
||||
#[derive(Clone)]
|
||||
pub struct GeneratorHolder {
|
||||
|
||||
Reference in New Issue
Block a user