use std::sync::Arc; use appflowy_integrate::RocksCollabDB; use flowy_error::FlowyError; use lib_infra::future::FutureResult; pub trait DocumentUser: Send + Sync { fn user_id(&self) -> Result; fn token(&self) -> Result, FlowyError>; // unused now. fn collab_db(&self) -> Result, FlowyError>; } /// A trait for document cloud service. /// Each kind of server should implement this trait. Check out the [AppFlowyServerProvider] of /// [flowy-server] crate for more information. pub trait DocumentCloudService: Send + Sync + 'static { fn get_document_updates(&self, document_id: &str) -> FutureResult>, FlowyError>; fn get_document_latest_snapshot( &self, document_id: &str, ) -> FutureResult, FlowyError>; } pub struct DocumentSnapshot { pub snapshot_id: i64, pub document_id: String, pub data: Vec, pub created_at: i64, }