Skip to main content

SyncModel

Trait SyncModel 

Source
pub trait SyncModel:
    Model<PrimaryKey = Uuid>
    + Send
    + Sync
    + 'static {
    const SYNC_NAME: &'static str;
    const SYNC_VERSION: u32 = 1;
    const AUTOMATIC_METADATA: bool = false;
    const REVISION_COLUMN: &'static str = "revision";
    const UPDATED_AT_COLUMN: &'static str = "updated_at";
    const DELETED_AT_COLUMN: &'static str = "deleted_at";
    const SCOPE_COLUMN: &'static str = "sync_scope";

    // Required method
    fn sync_fields() -> Vec<SyncField>;

    // Provided methods
    fn registered_fields() -> Vec<SyncField> { ... }
    fn sync_schema() -> TableSchema { ... }
}
Expand description

Shared model definition. Its client/server role belongs to registration.

Required Associated Constants§

Source

const SYNC_NAME: &'static str

Provided Associated Constants§

Source

const SYNC_VERSION: u32 = 1

Source

const AUTOMATIC_METADATA: bool = false

Derived sync models keep service columns out of the Rust struct.

Source

const REVISION_COLUMN: &'static str = "revision"

Source

const UPDATED_AT_COLUMN: &'static str = "updated_at"

Source

const DELETED_AT_COLUMN: &'static str = "deleted_at"

Source

const SCOPE_COLUMN: &'static str = "sync_scope"

Required Methods§

Provided Methods§

Source

fn registered_fields() -> Vec<SyncField>

Source

fn sync_schema() -> TableSchema

Physical schema, including infrastructure-owned service columns.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§