Skip to content

Feat/cs/foundation api#23

Merged
ReagentX merged 17 commits into
developfrom
feat/cs/foundation-api
Jun 7, 2026
Merged

Feat/cs/foundation api#23
ReagentX merged 17 commits into
developfrom
feat/cs/foundation-api

Conversation

@ReagentX

@ReagentX ReagentX commented Jun 6, 2026

Copy link
Copy Markdown
Owner
  • Add opt-in foundation cargo feature (off by default, zero deps, no_std, purely additive)
    • Typed accessors on Property: as_string, as_data, as_bool, as_i64/as_u64/as_f64, as_date/as_unix_time, as_url, is_null, class_name
    • Container accessors: as_array, as_set, as_dictionary
    • Centralized cluster-variant matching (immutable + mutable string/data/array/dict/set, plus attributed strings)
    • Safe signed/unsigned integer coercion, no int-float coercion; as_date returns 2001-epoch seconds
  • Add lazy, clone-cheap, zero-alloc view types
    • FoundationArray (+ FoundationArrayIter): len/is_empty/iter/get/first/IntoIterator
    • FoundationDict (+ FoundationDictIter): len/is_empty/iter/get/contains_key/keys/values/IntoIterator

@ReagentX ReagentX added the enhancement New feature or request label Jun 6, 2026
@ReagentX ReagentX moved this to In Progress in 4.2: Stream Orchid Jun 6, 2026
@ReagentX ReagentX requested a review from Copilot June 6, 2026 23:16
@ReagentX ReagentX self-assigned this Jun 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the foundation feature) with typed Property accessors (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.

Comment thread src/deserializer/number.rs Outdated
Comment thread src/deserializer/foundation/helpers.rs
Comment thread test_data/generators/generate.sh
Comment thread .github/workflows/test.yml
Comment thread .github/workflows/release.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 54 changed files in this pull request and generated 3 comments.

Comment thread src/deserializer/foundation/date.rs
Comment thread test_data/generators/generate.sh
Comment thread src/deserializer/typedstream.rs
@ReagentX ReagentX merged commit cf74d4c into develop Jun 7, 2026
1 check passed
@ReagentX ReagentX deleted the feat/cs/foundation-api branch June 7, 2026 00:19
@ReagentX ReagentX moved this from In Progress to Done in 4.2: Stream Orchid Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

2 participants