pub struct SyncEngine { /* private fields */ }Expand description
Coordinates document reconciliation and blob availability for a folder.
Implementations§
Source§impl SyncEngine
impl SyncEngine
pub const fn new( folder_manager: FolderManager, blob_store: BlobStore, docs_engine: DocsEngine, topic_tracker: Option<TopicTracker>, ) -> Self
Sourcepub fn with_node_db(self, node_db: NodeDatabase) -> Self
pub fn with_node_db(self, node_db: NodeDatabase) -> Self
Set the node database for checkpoint tracking.
pub fn from_node(node: &IrohNode, folder_manager: FolderManager) -> Self
Sourcepub async fn sync(
&self,
folder_id: NamespaceId,
mode: SessionMode,
) -> Result<IntentHandle>
pub async fn sync( &self, folder_id: NamespaceId, mode: SessionMode, ) -> Result<IntentHandle>
Start reconciling a managed folder.
Iroh Docs performs network reconciliation itself. This intent provides lifecycle, control, and aggregate transfer events around that process.
§Errors
Returns an error if the folder is not managed locally.
Sourcepub async fn sync_with_params(
&self,
folder_id: NamespaceId,
mode: SessionMode,
params: SubscribeParams,
) -> Result<IntentHandle>
pub async fn sync_with_params( &self, folder_id: NamespaceId, mode: SessionMode, params: SubscribeParams, ) -> Result<IntentHandle>
Start a synchronization intent with subscription filtering.
§Errors
Returns an error if the folder is not managed locally or live sync cannot be started.
Sourcepub async fn subscribe(
&self,
folder_id: NamespaceId,
params: SubscribeParams,
) -> Result<IntentHandle>
pub async fn subscribe( &self, folder_id: NamespaceId, params: SubscribeParams, ) -> Result<IntentHandle>
Subscribe to live changes in a folder.
§Errors
Returns an error if the folder is not managed locally or live sync cannot be started.
Sourcepub async fn fetch(
&self,
folder_id: NamespaceId,
strategy: FetchStrategy,
) -> Result<IntentHandle>
pub async fn fetch( &self, folder_id: NamespaceId, strategy: FetchStrategy, ) -> Result<IntentHandle>
Fetch folder content using a full or filtered reconciliation strategy.
Peer-count filters are applied by callers that have availability observations. The document subscription still carries path, size, and count limits so the remote reconciliation remains bounded.
§Errors
Returns an error if the folder is not managed locally or synchronization cannot be started.
Sourcepub async fn sync_with_filter(
&self,
folder_id: NamespaceId,
mode: SessionMode,
params: SubscribeParams,
filter: FilterEngine,
) -> Result<IntentHandle>
pub async fn sync_with_filter( &self, folder_id: NamespaceId, mode: SessionMode, params: SubscribeParams, filter: FilterEngine, ) -> Result<IntentHandle>
Start a synchronization intent and filter emitted entries.
The document reconciliation remains content-addressed and is handled by iroh-docs; the filter controls which entries are reported to the automatic synchronization consumer.
§Errors
Returns an error if the folder is not managed locally or live sync cannot be started.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SyncEngine
impl !UnwindSafe for SyncEngine
impl Freeze for SyncEngine
impl Send for SyncEngine
impl Sync for SyncEngine
impl Unpin for SyncEngine
impl UnsafeUnpin for SyncEngine
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more