Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dynamic_value.rs and schema.rs, enabling runtime type introspection #392

Merged
merged 1 commit into from
May 8, 2023

Conversation

dwrensha
Copy link
Member

@dwrensha dwrensha commented Apr 17, 2023

Adds dynamic_value::Reader, dynamic_struct::Reader, etc. These will enable a lot of new usage patterns, including making it easy for us to implement Debug for generated readers.

What holds this all together is a new Introspect trait, implemented for all Cap'n Proto types:

pub trait Introspect {
    fn introspect() -> Type;
}

The implementation is a mostly straightfoward port of capnproto-c++'s dynamic.h and schema.h.

@dwrensha dwrensha force-pushed the dynamic branch 17 times, most recently from f161640 to e183d0a Compare May 2, 2023 14:20
@dwrensha dwrensha force-pushed the dynamic branch 5 times, most recently from 6e8254d to e88ee42 Compare May 5, 2023 16:12
@dwrensha dwrensha marked this pull request as ready for review May 5, 2023 16:13
@dwrensha dwrensha changed the title work in progress on dynamic api add dynamic_value.rs and schema.rs, enabling runtime type introspection May 5, 2023
@dwrensha dwrensha force-pushed the dynamic branch 2 times, most recently from 0afc748 to 5af241c Compare May 8, 2023 14:29
@dwrensha dwrensha merged commit b257452 into master May 8, 2023
5 checks passed
@dwrensha dwrensha deleted the dynamic branch May 8, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change requires version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant