Offline-first sync protocol with command/outbox model for WASM clients
| Tier | infrastructure |
| Role | unclassified (baselined) |
| Path | crates/infrastructure/sync |
| Edition | 2021 |
| Targets | infrastructure_sync |
| Public items | 110 across 5 modules |
| Tests | 31 |
What it is for
# infrastructure-sync
Offline-first sync protocol with command/outbox model.
This crate provides the building blocks for offline-capable WASM admin clients that sync with a server when connectivity is available.
Core Concepts
- Commands: Intent-based operations (
CreatePage,UpdatePage,PublishPage) - Outbox: Queue of pending commands to sync when online
- Idempotency: Commands can be safely retried without duplicating effects
- Versioning: Optimistic concurrency with version tracking
- Conflicts: Structured conflict detection and resolution
Architecture
┌─────────────────────────────────────────────────────────────┐
│ WASM Client │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │
│ │ UI Layer │───▶│ Commands │───▶│ Outbox (IndexedDB) │ │
│ └──────────┘ └──────────┘ └──────────────────────┘ │
│ │ │
└────────────────────────────────────────────│────────────────┘
│ Online?
▼
┌─────────────────────────────────────────────────────────────┐
│ Server │
│ ┌──────────────┐ ┌──────────┐ ┌─────────────────┐ │
│ │ Command │───▶│ Validate │───▶│ Apply + Store │ │
│ │ Handler │ │ + Check │ │ (Postgres) │ │
│ └──────────────┘ │ Version │ └─────────────────┘ │
│ └──────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ │
│ │ Ack/Conflict │ │
│ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
Example
use infrastructure_sync::{
Command, CommandId, IdempotencyKey, OutboxEntry, OutboxStatus,
ServerAck, AckStatus, Conflict,
};
use uuid::Uuid;
// Create a command with idempotency key
let command = Command::CreatePage {
idempotency_key: IdempotencyKey::new(),
slug: "hello-world".to_string(),
title: "Hello World".to_string(),
page_type: "post".to_string(),
content: "My first post".to_string(),
};
// Queue in outbox
let entry = OutboxEntry::new(command);
assert_eq!(entry.status, OutboxStatus::Pending);
// Server processes and acknowledges
let ack = ServerAck::success(entry.command_id, Uuid::new_v4());
assert!(ack.is_success());
Capabilities
Command
Command types for intent-based operations.
| Item |
|---|
pub enum Command |
Command :: fn idempotency_key(& self) -> & IdempotencyKey |
Command :: fn command_type(& self) -> & 'static str |
Command :: fn is_cms_command(& self) -> bool |
Command :: fn is_media_command(& self) -> bool |
Command :: fn target_entity_id(& self) -> Option <Uuid> |
Command :: fn expected_version(& self) -> Option <& Version> |
CommandId
Command types for intent-based operations.
| Item |
|---|
pub struct CommandId |
CommandId :: fn new() -> Self |
CommandId :: fn from_uuid(id : Uuid) -> Self |
CommandId :: fn as_uuid(& self) -> Uuid |
CommandId :: fn default() -> Self |
CommandId :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
IdempotencyKey
Command types for intent-based operations.
| Item |
|---|
pub struct IdempotencyKey |
IdempotencyKey :: fn new() -> Self |
IdempotencyKey :: fn from_string(key : String) -> Self |
IdempotencyKey :: fn as_str(& self) -> & str |
IdempotencyKey :: fn default() -> Self |
IdempotencyKey :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
Conflict
Conflict detection and resolution types.
| Item |
|---|
pub enum Conflict |
Conflict :: fn version_mismatch(client_version : Version, server_version : Version, server_record : JsonValue,) -> Self |
Conflict :: fn field_conflicts(conflicts : Vec <FieldConflict>, server_record : JsonValue) -> Self |
Conflict :: fn entity_deleted(deleted_at : chrono::DateTime <chrono::Utc>, deleted_by : Option <String>,) -> Self |
Conflict :: fn unique_constraint(field : String, value : String, existing_entity_id : Option <uuid::Uuid>,) -> Self |
Conflict :: fn business_rule(rule : String, context : JsonValue) -> Self |
Conflict :: const fn is_version_mismatch(& self) -> bool |
Conflict :: const fn is_field_conflict(& self) -> bool |
Conflict :: const fn is_entity_deleted(& self) -> bool |
Conflict :: const fn client_version(& self) -> Option <& Version> |
Conflict :: const fn server_version(& self) -> Option <& Version> |
Conflict :: fn server_record(& self) -> Option <& JsonValue> |
ConflictResolution
Conflict detection and resolution types.
| Item |
|---|
pub enum ConflictResolution |
ConflictResolution :: const fn requires_user_action(& self) -> bool |
FieldConflict
Conflict detection and resolution types.
| Item |
|---|
pub struct FieldConflict |
FieldConflict :: fn new(field : String, client_value : JsonValue, server_value : JsonValue) -> Self |
FieldConflict :: fn with_base(field : String, client_value : JsonValue, server_value : JsonValue, base_value : JsonValue,) -> Self |
FieldConflict :: fn is_true_conflict(& self) -> bool |
FieldConflict :: fn only_client_changed(& self) -> bool |
FieldConflict :: fn only_server_changed(& self) -> bool |
OutboxEntry
Outbox queue for pending commands.
| Item |
|---|
pub struct OutboxEntry |
OutboxEntry :: fn new(command : Command) -> Self |
OutboxEntry :: fn mark_syncing(& mut self) |
OutboxEntry :: fn mark_synced(& mut self, entity_id : Uuid) |
OutboxEntry :: fn mark_retry(& mut self, error : String, retry_after : DateTime <Utc>) |
OutboxEntry :: fn mark_failed(& mut self, error : String) |
OutboxEntry :: fn mark_conflicted(& mut self, conflict_json : String) |
OutboxEntry :: fn is_ready_to_retry(& self) -> bool |
OutboxEntry :: fn calculate_retry_time(& self) -> DateTime <Utc> |
OutboxEntry :: fn max_retries_exceeded(& self, max_retries : u32) -> bool |
OutboxStats
Outbox queue for pending commands.
| Item |
|---|
pub struct OutboxStats |
OutboxStats :: const fn needs_processing(& self) -> usize |
OutboxStats :: const fn needs_attention(& self) -> usize |
OutboxStats :: const fn is_idle(& self) -> bool |
OutboxStatus
Outbox queue for pending commands.
| Item |
|---|
pub enum OutboxStatus |
OutboxStatus :: const fn needs_processing(& self) -> bool |
OutboxStatus :: const fn is_terminal(& self) -> bool |
OutboxStatus :: const fn requires_user_action(& self) -> bool |
Change
Pull protocol for syncing server changes to client.
| Item |
|---|
pub struct Change |
Change :: fn new(change_type : ChangeType, entity_type : String, entity_id : Uuid, version : Version, data : JsonValue,) -> Self |
Change :: fn created(entity_type : String, entity_id : Uuid, data : JsonValue) -> Self |
Change :: fn updated(entity_type : String, entity_id : Uuid, version : Version, data : JsonValue,) -> Self |
Change :: fn deleted(entity_type : String, entity_id : Uuid, version : Version) -> Self |
Change :: fn with_changed_by(mut self, user_id : Uuid) -> Self |
Change :: const fn with_changed_at(mut self, timestamp : DateTime <Utc>) -> Self |
Change :: const fn is_create(& self) -> bool |
Change :: const fn is_update(& self) -> bool |
Change :: const fn is_delete(& self) -> bool |
ChangeType
Pull protocol for syncing server changes to client.
| Item |
|---|
pub enum ChangeType |
ChangeType :: const fn is_create(& self) -> bool |
ChangeType :: const fn is_update(& self) -> bool |
ChangeType :: const fn is_delete(& self) -> bool |
PullRequest
Pull protocol for syncing server changes to client.
| Item |
|---|
pub struct PullRequest |
PullRequest :: fn since(since : DateTime <Utc>) -> Self |
PullRequest :: fn full_sync() -> Self |
PullRequest :: fn with_entity_types(mut self, types : Vec <String>) -> Self |
PullRequest :: const fn with_limit(mut self, limit : u32) -> Self |
PullRequest :: fn with_cursor(mut self, cursor : String) -> Self |
PullResponse
Pull protocol for syncing server changes to client.
| Item |
|---|
pub struct PullResponse |
PullResponse :: fn new(changes : Vec <Change>, sync_timestamp : DateTime <Utc>) -> Self |
PullResponse :: fn empty() -> Self |
PullResponse :: fn with_pagination(mut self, cursor : String, has_more : bool) -> Self |
PullResponse :: fn is_empty(& self) -> bool |
PullResponse :: fn count_by_type(& self) -> std::collections::HashMap <ChangeType, usize> |
AckStatus
Version tracking for optimistic concurrency control.
| Item |
|---|
pub enum AckStatus |
AckStatus :: const fn is_success(& self) -> bool |
AckStatus :: const fn is_retryable(& self) -> bool |
AckStatus :: const fn is_conflict(& self) -> bool |
AckStatus :: const fn is_permanent_error(& self) -> bool |
ServerAck
Version tracking for optimistic concurrency control.
| Item |
|---|
pub struct ServerAck |
ServerAck :: fn success(command_id : CommandId, entity_id : Uuid) -> Self |
ServerAck :: fn success_with_version(command_id : CommandId, entity_id : Uuid, new_version : Version,) -> Self |
ServerAck :: fn conflict(command_id : CommandId, conflict : Conflict) -> Self |
ServerAck :: fn retryable_error(command_id : CommandId, message : String) -> Self |
ServerAck :: fn permanent_error(command_id : CommandId, message : String) -> Self |
ServerAck :: const fn is_success(& self) -> bool |
ServerAck :: const fn is_conflict(& self) -> bool |
ServerAck :: const fn is_retryable(& self) -> bool |
Version
Version tracking for optimistic concurrency control.
| Item |
|---|
pub struct Version |
Version :: const fn new(version : u64) -> Self |
Version :: const fn value(& self) -> u64 |
Version :: const fn initial() -> Self |
Version :: const fn increment(& self) -> Self |
Version :: const fn is_newer_than(& self, other : & Self) -> bool |
Version :: fn default() -> Self |
Version :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result |
Version :: fn from(value : u64) -> Self |
VersionMismatch
Version tracking for optimistic concurrency control.
| Item |
|---|
pub struct VersionMismatch |
VersionMismatch :: const fn new(client_version : Version, server_version : Version) -> Self |
VersionMismatch :: const fn versions_behind(& self) -> u64 |
u64
Version tracking for optimistic concurrency control.
| Item |
|---|
u64 :: fn from(value : Version) -> Self |
How to use it
From this crate's own rustdoc:
## Example
Module structure
infrastructure_sync
commandconflictoutboxpullversion
flowchart TD n_infrastructure_sync["infrastructure_sync"] n_infrastructure_sync --> n_command["command"] n_infrastructure_sync --> n_conflict["conflict"] n_infrastructure_sync --> n_outbox["outbox"] n_infrastructure_sync --> n_pull["pull"] n_infrastructure_sync --> n_version["version"]
Public surface
`command`
| Item | What it is |
|---|---|
pub struct CommandId | Unique identifier for a command instance. |
CommandId :: fn new() -> Self | Create a new random command ID. |
CommandId :: fn from_uuid(id : Uuid) -> Self | Create from an existing UUID. |
CommandId :: fn as_uuid(& self) -> Uuid | Get the underlying UUID. |
CommandId :: fn default() -> Self | — |
CommandId :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
pub struct IdempotencyKey | Idempotency key for safe command retries |
IdempotencyKey :: fn new() -> Self | Create a new random idempotency key. |
IdempotencyKey :: fn from_string(key : String) -> Self | Create from an existing string. |
IdempotencyKey :: fn as_str(& self) -> & str | Get the key as a string slice. |
IdempotencyKey :: fn default() -> Self | — |
IdempotencyKey :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
pub enum Command | Commands that can be queued and synced |
Command :: fn idempotency_key(& self) -> & IdempotencyKey | Get the idempotency key for this command. |
Command :: fn command_type(& self) -> & 'static str | Get the command type as a string. |
Command :: fn is_cms_command(& self) -> bool | Check if this is a CMS command. |
Command :: fn is_media_command(& self) -> bool | Check if this is a media command. |
Command :: fn target_entity_id(& self) -> Option <Uuid> | Get the target entity ID if this command operates on an existing entity. |
Command :: fn expected_version(& self) -> Option <& Version> | Get the expected version if this command requires optimistic locking. |
`conflict`
| Item | What it is |
|---|---|
pub enum Conflict | A conflict that occurred during command processing. |
Conflict :: fn version_mismatch(client_version : Version, server_version : Version, server_record : JsonValue,) -> Self | Create a version mismatch conflict. |
Conflict :: fn field_conflicts(conflicts : Vec <FieldConflict>, server_record : JsonValue) -> Self | Create a field conflicts instance. |
Conflict :: fn entity_deleted(deleted_at : chrono::DateTime <chrono::Utc>, deleted_by : Option <String>,) -> Self | Create an entity deleted conflict. |
Conflict :: fn unique_constraint(field : String, value : String, existing_entity_id : Option <uuid::Uuid>,) -> Self | Create a unique constraint conflict. |
Conflict :: fn business_rule(rule : String, context : JsonValue) -> Self | Create a business rule conflict. |
Conflict :: const fn is_version_mismatch(& self) -> bool | Check if this is a version mismatch. |
Conflict :: const fn is_field_conflict(& self) -> bool | Check if this is a field conflict. |
Conflict :: const fn is_entity_deleted(& self) -> bool | Check if the entity was deleted. |
Conflict :: const fn client_version(& self) -> Option <& Version> | Get the client version if this is a version mismatch. |
Conflict :: const fn server_version(& self) -> Option <& Version> | Get the server version if this is a version mismatch. |
Conflict :: fn server_record(& self) -> Option <& JsonValue> | Get the server record if available. |
pub struct FieldConflict | A conflict on a specific field. |
FieldConflict :: fn new(field : String, client_value : JsonValue, server_value : JsonValue) -> Self | Create a new field conflict. |
FieldConflict :: fn with_base(field : String, client_value : JsonValue, server_value : JsonValue, base_value : JsonValue,) -> Self | Create with a base value for three-way merge. |
FieldConflict :: fn is_true_conflict(& self) -> bool | Check if both sides changed from the base (true conflict). |
FieldConflict :: fn only_client_changed(& self) -> bool | Check if only the client changed (can auto-merge). |
FieldConflict :: fn only_server_changed(& self) -> bool | Check if only the server changed (can auto-merge by taking server). |
pub enum ConflictResolution | How to resolve a conflict. |
ConflictResolution :: const fn requires_user_action(& self) -> bool | Check if this requires user interaction. |
`outbox`
| Item | What it is |
|---|---|
pub enum OutboxStatus | Status of an outbox entry. |
OutboxStatus :: const fn needs_processing(& self) -> bool | Check if this entry needs to be processed. |
OutboxStatus :: const fn is_terminal(& self) -> bool | Check if this entry is in a final state. |
OutboxStatus :: const fn requires_user_action(& self) -> bool | Check if this entry requires user intervention. |
pub struct OutboxEntry | An entry in the outbox queue. |
OutboxEntry :: fn new(command : Command) -> Self | Create a new outbox entry. |
OutboxEntry :: fn mark_syncing(& mut self) | Mark as currently syncing. |
OutboxEntry :: fn mark_synced(& mut self, entity_id : Uuid) | Mark as successfully synced. |
OutboxEntry :: fn mark_retry(& mut self, error : String, retry_after : DateTime <Utc>) | Mark as failed with retry. |
OutboxEntry :: fn mark_failed(& mut self, error : String) | Mark as failed permanently. |
OutboxEntry :: fn mark_conflicted(& mut self, conflict_json : String) | Mark as conflicted. |
OutboxEntry :: fn is_ready_to_retry(& self) -> bool | Check if ready to retry. |
OutboxEntry :: fn calculate_retry_time(& self) -> DateTime <Utc> | Calculate next retry time with exponential backoff. |
OutboxEntry :: fn max_retries_exceeded(& self, max_retries : u32) -> bool | Check if max retries exceeded. |
pub struct OutboxStats | Statistics about the outbox queue. |
OutboxStats :: const fn needs_processing(& self) -> usize | Count entries that need processing. |
OutboxStats :: const fn needs_attention(& self) -> usize | Count entries that need user attention. |
OutboxStats :: const fn is_idle(& self) -> bool | Check if outbox is empty of actionable items. |
`pull`
| Item | What it is |
|---|---|
pub struct PullRequest | Request to pull changes from the server. |
PullRequest :: fn since(since : DateTime <Utc>) -> Self | Create a request to pull all changes since a timestamp. |
PullRequest :: fn full_sync() -> Self | Create a request for initial sync (all data). |
PullRequest :: fn with_entity_types(mut self, types : Vec <String>) -> Self | Filter to specific entity types. |
PullRequest :: const fn with_limit(mut self, limit : u32) -> Self | Limit the number of changes. |
PullRequest :: fn with_cursor(mut self, cursor : String) -> Self | Continue from a cursor. |
pub struct PullResponse | Response containing changes from the server. |
PullResponse :: fn new(changes : Vec <Change>, sync_timestamp : DateTime <Utc>) -> Self | Create a new pull response. |
PullResponse :: fn empty() -> Self | Create an empty response. |
PullResponse :: fn with_pagination(mut self, cursor : String, has_more : bool) -> Self | Add pagination info. |
PullResponse :: fn is_empty(& self) -> bool | Check if there are any changes. |
PullResponse :: fn count_by_type(& self) -> std::collections::HashMap <ChangeType, usize> | Count changes by type. |
pub enum ChangeType | Type of change. |
ChangeType :: const fn is_create(& self) -> bool | Check if this is a create. |
ChangeType :: const fn is_update(& self) -> bool | Check if this is an update. |
ChangeType :: const fn is_delete(& self) -> bool | Check if this is a delete. |
pub struct Change | A single change from the server. |
Change :: fn new(change_type : ChangeType, entity_type : String, entity_id : Uuid, version : Version, data : JsonValue,) -> Self | Create a new change. |
Change :: fn created(entity_type : String, entity_id : Uuid, data : JsonValue) -> Self | Create a "created" change. |
Change :: fn updated(entity_type : String, entity_id : Uuid, version : Version, data : JsonValue,) -> Self | Create an "updated" change. |
Change :: fn deleted(entity_type : String, entity_id : Uuid, version : Version) -> Self | Create a "deleted" change. |
Change :: fn with_changed_by(mut self, user_id : Uuid) -> Self | Set who made the change. |
Change :: const fn with_changed_at(mut self, timestamp : DateTime <Utc>) -> Self | Set when the change occurred. |
Change :: const fn is_create(& self) -> bool | Check if this is a create. |
Change :: const fn is_update(& self) -> bool | Check if this is an update. |
Change :: const fn is_delete(& self) -> bool | Check if this is a delete. |
`version`
| Item | What it is |
|---|---|
pub struct Version | Version number for optimistic concurrency control |
Version :: const fn new(version : u64) -> Self | Create a new version. |
Version :: const fn value(& self) -> u64 | Get the version number. |
Version :: const fn initial() -> Self | Create the initial version (1). |
Version :: const fn increment(& self) -> Self | Increment the version. |
Version :: const fn is_newer_than(& self, other : & Self) -> bool | Check if this version is newer than another. |
Version :: fn default() -> Self | — |
Version :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result | — |
Version :: fn from(value : u64) -> Self | — |
u64 :: fn from(value : Version) -> Self | — |
pub struct VersionMismatch | Version mismatch information. |
VersionMismatch :: const fn new(client_version : Version, server_version : Version) -> Self | Create a new version mismatch. |
VersionMismatch :: const fn versions_behind(& self) -> u64 | How many versions behind is the client? |
pub enum AckStatus | Status of a server acknowledgment. |
AckStatus :: const fn is_success(& self) -> bool | Check if the command succeeded. |
AckStatus :: const fn is_retryable(& self) -> bool | Check if the command can be retried. |
AckStatus :: const fn is_conflict(& self) -> bool | Check if there was a conflict. |
AckStatus :: const fn is_permanent_error(& self) -> bool | Check if this is a permanent failure. |
pub struct ServerAck | Server acknowledgment of a command. |
ServerAck :: fn success(command_id : CommandId, entity_id : Uuid) -> Self | Create a success acknowledgment. |
ServerAck :: fn success_with_version(command_id : CommandId, entity_id : Uuid, new_version : Version,) -> Self | Create a success acknowledgment with version. |
ServerAck :: fn conflict(command_id : CommandId, conflict : Conflict) -> Self | Create a conflict acknowledgment. |
ServerAck :: fn retryable_error(command_id : CommandId, message : String) -> Self | Create a retryable error acknowledgment. |
ServerAck :: fn permanent_error(command_id : CommandId, message : String) -> Self | Create a permanent error acknowledgment. |
ServerAck :: const fn is_success(& self) -> bool | Check if the command succeeded. |
ServerAck :: const fn is_conflict(& self) -> bool | Check if there was a conflict. |
ServerAck :: const fn is_retryable(& self) -> bool | Check if the command can be retried. |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
{AckStatus,ServerAck,Version,VersionMismatch} | version::{AckStatus,ServerAck,Version,VersionMismatch} |
{Change,ChangeType,PullRequest,PullResponse} | pull::{Change,ChangeType,PullRequest,PullResponse} |
{Command,CommandId,IdempotencyKey} | command::{Command,CommandId,IdempotencyKey} |
{Conflict,ConflictResolution,FieldConflict} | conflict::{Conflict,ConflictResolution,FieldConflict} |
{HasId,SoftDeletable,Timestamped} | foundation_basemodels::{HasId,SoftDeletable,Timestamped} |
{OutboxEntry,OutboxStats,OutboxStatus} | outbox::{OutboxEntry,OutboxStats,OutboxStatus} |
Boundary
Reaches into foundation.
Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | infrastructure |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/infrastructure/sync |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_infrastructure["infrastructure"] --> n_foundation["foundation"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-basemodels` | foundation | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
chrono | ^0.4 | serde | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
thiserror | ^2 | — | no | always |
uuid | ^1 | v4, v7, serde, js | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio-test | ^0.4 | — | no | always |
Build. None.
Depended on by. 2 workspace crates.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_application_sync["application-sync"] -->|uses| SELF n_platform_wasm_ui["platform-wasm-ui"] -->|uses| SELF SELF["infrastructure-sync"] SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | infrastructure_sync | `src/lib.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
2 workspace crates depend on this one: application-sync, platform-wasm-ui.
Verification
| Kind | Count |
|---|---|
| Unit tests | 31 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 1 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
command | 3 | 0 | 3 |
conflict | 3 | 0 | 2 |
outbox | 3 | 0 | 3 |
pull | 4 | 0 | 4 |
version | 4 | 0 | 3 |
What the tests establish, by name:
test_command_id_uniqueness—src/command.rstest_command_serialization—src/command.rstest_command_type—src/command.rstest_idempotency_key_serialization—src/command.rstest_conflict_serialization—src/conflict.rstest_field_conflict_detection—src/conflict.rstest_only_client_changed—src/conflict.rstest_version_mismatch_conflict—src/conflict.rstest_command_round_trip—src/lib.rstest_conflict_detection—src/lib.rstest_idempotency_key_uniqueness—src/lib.rstest_outbox_workflow—src/lib.rstest_pull_request_response—src/lib.rstest_server_ack_conflict—src/lib.rstest_server_ack_success—src/lib.rstest_exponential_backoff—src/outbox.rstest_outbox_entry_creation—src/outbox.rstest_outbox_stats—src/outbox.rstest_outbox_workflow—src/outbox.rstest_retry_workflow—src/outbox.rstest_status_checks—src/outbox.rstest_change_serialization—src/pull.rstest_change_types—src/pull.rstest_full_sync_request—src/pull.rstest_pull_request_creation—src/pull.rstest_pull_response—src/pull.rstest_ack_status_serialization—src/version.rstest_server_ack_success—src/version.rstest_version_increment—src/version.rstest_version_mismatch—src/version.rs- _… 1 more_
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 102 | 110 |
Public modules with a //! block | 5 | 5 |
pie showData
title Public items with rustdoc
"Documented" : 102
"No rustdoc detected" : 8
Metrics
| Metric | Value |
|---|---|
| Rust source files | 6 |
| Source lines | 1816 |
| Code lines | 1291 |
| Public API items | 110 |
| Public modules | 5 |
| Tests | 31 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 6 |
| Workspace reverse dependencies | 2 |
pie showData
title Public API by kind
"enum" : 6
"method" : 93
"struct" : 11
pie showData
title Rust source composition
"Code" : 1291
"Blank or comment" : 525
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.