Skip to content

api: re-export third party crates that appear in public api #3365

@TheButlah

Description

@TheButlah

There are various cases where third party types appear in the public api. For example, ProtocolHandler::accept returns a BoxFuture, which comes from n0-future.

Iroh should ideally pub use n0_futures::boxed::BoxFuture so that it is possible for end users to name the actual type (such as in a trait impl) without having to add n0_futures as a dependency to their own crate (and risking dependency hell when there is a mismatch), or alternatively re-export the whole crate. Note that:

  • re-exporting a crate implies that any breaking change to the version of that crate also implies breaking changes to your crate too
  • if you re-export only the type, it might not be useful enough without the rest of its crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions