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
cfCore Foundation value, collection, locale, formatter, and runtime wrappers
cgCoreGraphics value types + bitmap drawing wrapperscg
iosurfaceIOSurface (zero-copy GPU buffers)iosurface
dispatch_queueGrand Central Dispatchdispatch
cmCoreMedia time / sample / buffer wrapperscm
cvCoreVideo pixel-buffer wrapperscv
utilsshared FFI helpers (always on)

§Architecture

Safe Rust API (CGRect, CGContext, IOSurface, DispatchQueue, ...)
    ├── direct Apple framework FFI (src/cg/mod.rs)
    └── Swift @_cdecl bridge FFI (src/ffi/mod.rs)
            └── swift-bridge/Sources/...
                    └── Apple Core* frameworks

Re-exports§

pub use utils::FourCharCode;

Modules§

cf
Safe Core Foundation wrappers.
cgcg
Core Graphics types for screen coordinates, dimensions, and bitmap drawing.
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
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.

Structs§

CFError
Generic Core Foundation / Core Graphics creation error.