Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new swift interop module (Swift ABI calls via AArch64 inline assembly) and uses it to introduce initial DockKit.framework bindings behind a new dk feature, plus an iOS example demonstrating basic usage.
Changes:
- Introduces
cidre::swift(ABI helpers + retained wrappers for SwiftString,Array, and class objects). - Adds
cidre::dkDockKit bindings (AccessoryManager, Accessory, enums, error constants, and async StateChanges plumbing). - Updates crate features/examples/build configuration to support Swift/DockKit linking and an example binary.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| cidre/src/swift/abi.rs | New AArch64 Swift runtime/ABI call shims (inline assembly). |
| cidre/src/swift/array.rs | Retained wrapper for native Swift Array storage + helpers/tests. |
| cidre/src/swift/int.rs | Defines Swift Int/UInt type aliases. |
| cidre/src/swift/object.rs | Retained wrapper for Swift class object references. |
| cidre/src/swift/string.rs | Retained wrapper for Swift String ABI values + small-string constructor/tests. |
| cidre/src/swift.rs | Exposes the Swift interop module and re-exports key types. |
| cidre/src/lib.rs | Wires in dk and swift modules behind platform/feature cfgs. |
| cidre/src/dk.rs | New DockKit module surface + basic tests. |
| cidre/src/dk/error.rs | DockKitError constants + hash accessor via Swift ABI. |
| cidre/src/dk/accessory_manager.rs | DockAccessoryManager bindings (shared, properties, throwing getter). |
| cidre/src/dk/accessory.rs | Main DockAccessory bindings, resilient enum helpers, and async StateChanges task glue. |
| cidre/examples/dock-kit/main.rs | Example program demonstrating DockKit usage and printing status/changes. |
| cidre/Cargo.toml | Adds dk and swift features; registers dock-kit example. |
| cidre/build.rs | Adds Swift runtime rpath when swift feature is enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+96
to
+101
| in("x1") core::ptr::null_mut::<()>(), | ||
| in("x2") future_result_type, | ||
| in("x3") function, | ||
| in("x4") context, | ||
| in("x5") initial_context_size, | ||
| lateout("x1") initial_context, |
Comment on lines
+118
to
+123
| asm!( | ||
| "bl {f}", | ||
| f = sym swift_task_create, | ||
| inlateout("x0") flags => task, | ||
| in("x1") core::ptr::null_mut::<()>(), | ||
| in("x2") future_result_type, |
Comment on lines
+287
to
+288
| in("x1") element, | ||
| lateout("x1") elements, |
Comment on lines
+445
to
+446
| in("x0") object, | ||
| lateout("x0") word0, |
Comment on lines
+545
to
+546
| in("x0") value, | ||
| lateout("x0") word0, |
| tracking_button_enabled, | ||
| })); | ||
|
|
||
| abi::destroy_value(task.result.as_ptr().cast(), task.payload_metadata); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.