Skip to main content

Crate apple_cf

Crate apple_cf 

Source
Expand description

apple-cf — safe, dependency-free Rust bindings for Apple’s shared Core* frameworks.

This crate is the foundation of the doom-fish macOS Rust suite. It exists so framework-agnostic types like cg::CGRect, iosurface::IOSurface, and [DispatchQueue] don’t have to be re-vendored by every crate that builds on top of CMSampleBuffer/CVPixelBuffer/etc.

§Modules

ModuleFrameworkFeature flag
cgCoreGraphics value typescg
iosurfaceIOSurface (zero-copy GPU buffers)iosurface
dispatch_queueGrand Central Dispatchdispatch
utilsshared FFI helpers (always on)

Future frameworks (CoreMedia, CoreVideo, Metal) will be added as separate features so that downstream crates only pull in what they need.

§Architecture

Safe Rust API (CGRect, IOSurface, DispatchQueue, ...)
    └── extern "C" FFI declarations (src/ffi/mod.rs)
            └── Swift @_cdecl bridge (swift-bridge/Sources/...)
                    └── Apple Core* frameworks

Re-exports§

pub use utils::FourCharCode;

Modules§

cgcg
Core Graphics types for screen coordinates and dimensions
cmcm
CoreMedia primitives — CMTime, CMSampleBuffer, CMBlockBuffer, CMFormatDescription, audio buffer list bridging.
cvcv
Core Video types and wrappers.
dispatch_queuedispatch
Dispatch Queue wrapper for custom queue management
ffi
Raw FFI declarations for the Swift bridge.
iosurfaceiosurface
IOSurface - Hardware-accelerated surface
metalmetal
Metal interop — zero-copy GPU access to IOSurface-backed pixel data.
prelude
Common imports for users of this crate.
utils
Shared utilities used by other modules in this crate and by downstream crates that build on top of the apple-cf bridge.