Feat/cs/foundation api#23
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an opt-in foundation Cargo feature that layers typed, no_std-friendly convenience APIs on top of the existing Property traversal model, plus new fixtures and tests to validate Foundation class decoding.
Changes:
- Introduces
deserializer::foundation(behind thefoundationfeature) with typedPropertyaccessors (as_string,as_data,as_i64/as_u64/as_f64,as_date/as_unix_time,as_url,is_null,class_name) and lazy views (FoundationArray,FoundationDict). - Adds macOS-only Swift + shell generators for committed Foundation typedstream fixtures.
- Updates docs/metadata and CI to build/test with feature flags.
Reviewed changes
Copilot reviewed 23 out of 52 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test_data/generators/generate.sh | macOS-only fixture regeneration script for Foundation typedstreams. |
| test_data/generators/foundation.swift | Swift generator that emits one NSArchiver typedstream fixture per invocation. |
| src/lib.rs | Enables docs.rs doc_cfg support and re-exports Property alongside existing public API. |
| src/deserializer/number.rs | Minor comment tweak in number parsing tests. |
| src/deserializer/mod.rs | Gates new foundation module behind cfg(feature = "foundation") and exposes it in docs. |
| src/deserializer/foundation/url.rs | Implements Property::as_url + tests using fixtures. |
| src/deserializer/foundation/test_support.rs | Shared fixture loader for Foundation accessor tests. |
| src/deserializer/foundation/string.rs | Implements Property::as_string for string + attributed string clusters, with tests. |
| src/deserializer/foundation/number.rs | Implements strict numeric accessors (as_i64/as_u64/as_f64) + tests. |
| src/deserializer/foundation/null.rs | Implements Property::is_null + tests. |
| src/deserializer/foundation/names.rs | Centralizes Foundation cluster class name lists (string/data/array/dict/set). |
| src/deserializer/foundation/mod.rs | Foundation feature module root, docs, and re-exports for view types. |
| src/deserializer/foundation/helpers.rs | Shared helper(s) for class matching and container count handling. |
| src/deserializer/foundation/dict.rs | Implements as_dictionary and FoundationDict/iter APIs + tests. |
| src/deserializer/foundation/date.rs | Implements as_date/as_unix_time + tests. |
| src/deserializer/foundation/class.rs | Implements class_name escape hatch + tests. |
| src/deserializer/foundation/bytes.rs | Implements as_data for NSData cluster + tests. |
| src/deserializer/foundation/boolean.rs | Implements as_bool on top of integer accessor + tests. |
| src/deserializer/foundation/array.rs | Implements as_array/as_set and FoundationArray/iter APIs + tests. |
| README.md | Documents std and new foundation feature flags with an enablement example. |
| Cargo.toml | Adds foundation feature and docs.rs metadata for doc_cfg. |
| .github/workflows/test.yml | Updates CI commands to run clippy/tests with --all-features. |
| .github/workflows/release.yml | Updates release workflow to test with --all-features before publishing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
foundationcargo feature (off by default, zero deps,no_std, purely additive)Property:as_string,as_data,as_bool,as_i64/as_u64/as_f64,as_date/as_unix_time,as_url,is_null,class_nameas_array,as_set,as_dictionaryas_datereturns 2001-epoch secondsFoundationArray(+FoundationArrayIter):len/is_empty/iter/get/first/IntoIteratorFoundationDict(+FoundationDictIter):len/is_empty/iter/get/contains_key/keys/values/IntoIterator