Skip to content

Use the main name for trait interface protocols/interfaces #2689

@bendk

Description

@bendk

When you have a trait interface named Foo without with_foreign we currently name things like this:

  • FooProtocol -- the protocol for the trait (there's a couple variations on this, like FooInterface)
  • Foo -- the name of the type that implements the trait by calling into Rust.

I think we should swatch to using Foo and FooImpl for these items, i.e. swapping which thing gets the main name. Foo seems like a more natural name for the protocol/interface, since it's the foreign language equivalent of the Foo trait in Rust. Also, it's less error prone since users and UniFFI devs are likely to subclass Foo and it's not always safe to subclass the implementation type (see #2685).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions