Expand description
§doom-fish-utils
Framework-agnostic FFI utilities shared by the doom-fish family of safe Rust bindings to Apple SDKs.
§Modules
| Module | Purpose |
|---|---|
completion | Sync and async completion handlers for FFI callbacks |
ffi_callbacks | Common extern "C" callback type aliases shared across bridge crates |
ffi_string | Owned-string helpers around heap-allocated C strings |
four_char_code | FourCharCode wrapper (used by pixel formats, OSType codes, etc.) |
panic_safe | Catches panics inside extern "C" callbacks so they don’t unwind across the FFI boundary |
stream | Executor-agnostic bounded async streams (waker + VecDeque + lossy oldest-drop policy) |
§Design tenets
- Executor-agnostic. No tokio / async-std / smol dependencies; works
anywhere
std::future::Futureworks. - Defence in depth. The async completion path uses an
AtomicBoolconsumedflag to prevent double-fire UAF in the face of misbehaving Swift callbacks. - Panic-safe.
extern "C"callbacks pass throughpanic_safewrappers so an unexpected Rust panic logs and returns rather than unwinding into Swift / C code.
§Stability
This crate is the foundation of every doom-fish Apple-SDK binding crate. Breaking changes ship as major version bumps; minor versions add modules or non-breaking helpers.
Re-exports§
pub use four_char_code::FourCharCode;
Modules§
- completion
- Synchronous completion utilities for async FFI callbacks
- ffi_
callbacks - Common
extern "C"callback type aliases used across the doom-fish family. - ffi_
string - FFI string utilities
- four_
char_ code - Minimal
FourCharCodeimplementation for pixel formats and color conversions - panic_
safe - Panic-safety helpers for the C ABI boundary.
- stream
- Executor-agnostic bounded async streams for FFI callbacks.