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

Bind to uniffi using proc macros #29

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Nov 15, 2024

  1. Bind to uniffi using proc macros

    Proc macros let rust-analyzer check that types are compatible
    at rust compile time, and thus let downstream projects more easily
    depend on bitcoin-ffi.
    
    The `Network` enum is defined in the UDL file, but we need to define it
    in rust with `uniffi::Enum` in order to check UniFFI bindings at rust
    compile time.
    
    "It is permitted to use this [`uniffi::Enum`] macro on a type that is
    also defined in the UDL file as long as the two definitions are equal in
    the names and ordering of variants and variant fields"
    
    see: https://mozilla.github.io/uniffi-rs/latest/proc_macro/index.html#the-uniffienum-derive
    DanGould committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    a5551b2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6e3b595 View commit details
    Browse the repository at this point in the history
  3. Define custom String type with complete macro

    Separate `uniffi::custom_type` and `impl_string_custom_typedef`
    calls were made to define uniffi String types. This combines them
    into one macro.
    DanGould committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    24a53bc View commit details
    Browse the repository at this point in the history