Skip to main content

SyncGate

Trait SyncGate 

Source
pub trait SyncGate: Send + Sync {
    // Required method
    fn should_sync(
        &self,
        collection: &str,
        fields: &HashMap<String, Value>,
    ) -> bool;
}
Expand description

Per-document policy deciding whether a write may leave this node via sync.

Returning false keeps the document local-only: it is still written to local CRDT state, the local FTS index, and the local vector index (so local reads and search work), but it is excluded from every outbound sync channel.

Required Methods§

Source

fn should_sync(&self, collection: &str, fields: &HashMap<String, Value>) -> bool

Decide whether a document write should be synced. Called with the collection name and the document’s fields (so the policy can inspect, e.g., a share field).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§