#reflection #enums #type #struct #macro #c-comaptible

ffi_reflect

Provides a derive macro that genreates a reflection method for C-comaptible types

3 stable releases

1.0.2 May 16, 2023
1.0.1 May 10, 2023
1.0.0 May 6, 2023

#169 in FFI

Download history 3/week @ 2024-02-16 12/week @ 2024-02-23 4/week @ 2024-03-01 11/week @ 2024-03-08 6/week @ 2024-03-15 41/week @ 2024-03-29 13/week @ 2024-04-05

54 downloads per month
Used in ffi_reflect_csharp

MIT license

6KB
102 lines

ffi_reflect

The ffi_reflect is a compile time reflection library, that provides the FfiReflect derive macro. The macro itself generates a fucntion pub const fn ffi_reflect() -> FfiType<'static> that can be useful for bindings generation.

You can derive the FfiReflect only on structs that are marked with #[repr(C)] or #[repr(transparent)], on enums that are marked with #[repr($INTEGER_TYPE)] and unions that are marked with #[repr(C)].

You can use the ffi_reflect_csharp to generate C#-types with the exact same memory layout.

Dependencies

~315–770KB
~18K SLoC