Drew's Foundation bindings for Rust
September 3, 2022 ยท View on GitHub

Drew's Foundation bindings for Rust
This library binds (some subset of) Apple Foundation to Rust. It may be compared to objc-foundation and cocoa-foundation.
Part of the objr expanded universe, distinctive features of foundationr:
- Zero-cost abstractions. Calling this library should perform identically to calling Foundation from Swift/ObjC applications.
- Fast enumeration. This avoids the need to use the ObjC runtime to do something like enumerate many objects.
- Safe APIs. Where possible APIs are designed with safe abstractions to provide familiar guarantees to Rust developers
- Low-level. These bindings assume familiarity with Foundation APIs and are not documented separately.
- Modular. Foundation is a big library; individual features are gated with feature flags
- Free for noncommercial or "small commercial" use.
Table of features
The scope of this project is to implement "all of foundation", however, in practice, I mostly have time to implement APIs I actually use in other projects.
The following cargo features are currently supported, and provide at least some APIs on each type:
Core types
nsstringnsdatansdictionarynsvaluensrangensdatensnenumeratornsarraynsattributedstring
Runtime
nscopying
System
nsthreadnsnotificationnsrunloop
HTTP and URLs
nsurlnsurlresponsensurlrequestnsurlsession
Other
all- enables all other features