cloudkit
Safe Rust bindings for Apple's CloudKit framework on macOS.
Status: v0.3.0 keeps the fully audited CloudKit surface from v0.2.1 and adds an optional
asyncfeature withFuture-based container, database, and selected operation wrappers backed by the Swift bridge. See COVERAGE.md and COVERAGE_AUDIT.md for the audited SDK/header-to-source map.
Quick start
use *;
Highlights
CKContainerdefault/custom containers, account status, user-record lookup, user-identity discovery, and share-participant lookupCKDatabaserecord CRUD, first-batch query helpers, fetched query results, record-zone helpers, and subscription helpers- Optional
asyncfeature with executor-agnosticFuturewrappers for container status/identity calls, database queries/record access, and selected record/database-change operations - Value-layer Rust wrappers for
CKRecord,CKRecordID,CKRecordZone,CKAsset,CKReference,CKNotificationInfo,CKNotification*,CKServerChangeToken,CKUserIdentity,CKShare,CKShareMetadata, andCKSyncEngine - Operation builders for generic
CKOperation*configuration plus record-zone, subscription, share metadata / acceptance / access-request, web-auth token, and existing record/query/database-change operations - Exported
CloudKitconstants for container, error, query, record, zone, and share keys alongside expanded sharing-option helpers and system-sharing observers - Headless numbered examples
01–15plus per-area integration tests andtests/expanded_surface_tests.rs
Validation
The v0.3.0 bridge is validated with:
for; do ; done
Entitlements / caveats
CloudKit requires an entitled app plus an iCloud account for most server-backed operations.
Unsigned CLI binaries commonly hit CKErrorMissingEntitlement, CKErrorBadContainer, or CKErrorNotAuthenticated. When CKContainer::default() cannot be resolved because the current process has no iCloud container entitlement, the crate surfaces a bridge error instead of letting CloudKit raise an Objective-C exception. Headless tests and examples can therefore report entitlement/account limitations gracefully instead of crashing.
Examples
Run the defensive framework smoke test with:
Other numbered examples cover the expanded logical areas:
02_database_zones_and_subscriptions03_record_value_roundtrip04_record_id_construction05_zone_construction06_subscription_builders07_operation_builders08_share_local_construction09_notification_info_builder10_query_builder11_fetched_results_smoke12_reference_utility13_server_change_token_bytes14_asset_file_url15_user_identity_lookup
License
Licensed under either Apache-2.0 or MIT at your option.