pub trait SyncEndpoint {
type Record: Serialize + DeserializeOwned + Send + Sync + 'static;
type Query: Serialize + Send + Sync;
const RESOURCE: &'static str;
const CURRENT_SCHEMA_VERSION: u32 = 1;
}Expand description
One sync-able platform resource.
Implemented by zero-sized marker types — you call methods like
client.sync::<VoiceCalls>(&items) rather than constructing a
VoiceCalls value.
Required Associated Constants§
Provided Associated Constants§
Sourceconst CURRENT_SCHEMA_VERSION: u32 = 1
const CURRENT_SCHEMA_VERSION: u32 = 1
Current wire-schema version for this resource’s Record type.
Bumped when the meaning of an existing field changes (a rare,
deliberate event). Additive field changes don’t require a
version bump — they ride on the additive-only policy
(see wavekat-voice/docs/21-platform-call-history-sync.md
§“Versioning and forward compatibility”).
Used by Client::sync so consumers don’t manage the version
themselves — upgrading the bridge crate picks up the right
number automatically. Default is 1.
Required Associated Types§
Sourcetype Record: Serialize + DeserializeOwned + Send + Sync + 'static
type Record: Serialize + DeserializeOwned + Send + Sync + 'static
One row’s worth of data. Must round-trip through JSON; the wire
shape uses camelCase per the platform’s Hono/Zod convention
(apply #[serde(rename_all = "camelCase")] on your struct).
Records must embed SyncEnvelope via
#[serde(flatten)] pub envelope: SyncEnvelope so the
schemaVersion + extras fields appear at the top of the
JSON object alongside the resource-specific columns. The
trait doesn’t enforce this via an associated type because
#[serde(flatten)] is a serde attribute (not a Rust trait
bound), but every record type ships with the envelope and
Client::sync relies on the field name schemaVersion.
See VoiceCallRecord for the canonical shape.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.