Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Audit public APIs #73

Open
hawkw opened this issue Nov 5, 2018 · 0 comments
Open

Audit public APIs #73

hawkw opened this issue Nov 5, 2018 · 0 comments
Assignees
Labels
crate/core Issues and features relating to the `tokio-trace-core` crate kind/enhancement New feature or request
Milestone

Comments

@hawkw
Copy link
Owner

hawkw commented Nov 5, 2018

Before releasing tokio-trace-core 0.1, we should give a thorough pass to all the publicly exposed traits, functions, types, and fields in the core crate.

Some things to consider:

  • Does it need to be part of the public API surface?
  • Public fields should be replaced with accessor functions whenever possible (so that we can change internal representations without causing a breaking change).
  • For types:
    • If it's an enum, is it intended to be matched exhaustively? If not, can it be made private, wrapped in a struct, and replaced with methods to test/construct individual variants (such as the subscriber error types)?
    • Are there traits in std that the type should implement (i.e., error types should implement std::error::Error)?
  • For traits:
    • Are there types in std that should implement the trait (i.e. Option<Id> can implement AsId, etc)?
    • Is it intended to be implemented by users of the crate? If not, it should probably be sealed so it cannot be implemented.
@hawkw hawkw added the kind/enhancement New feature or request label Nov 5, 2018
@hawkw hawkw added this to the core 0.1 milestone Nov 5, 2018
@hawkw hawkw self-assigned this Nov 5, 2018
@hawkw hawkw added the crate/core Issues and features relating to the `tokio-trace-core` crate label Nov 5, 2018
hawkw added a commit that referenced this issue Nov 14, 2018
This branch rewrites the `RecordError` and `FollowsError` types so that
the publicly-exposed type is a struct, rather than an enum. Consumers of
the API may still test what type of error occurred with a set of
`is_{error kind}` methods, but new error kinds may now be added without
causing a breaking change, as the struct cannot be matched against.

This is required for #73.

Signed-off-by: Eliza Weisman <[email protected]>
hawkw added a commit that referenced this issue Nov 15, 2018
Since events no longer have to be constructed as struct initializers, we
can remove its fields from the public API.

This is in service of #73.

Signed-off-by: Eliza Weisman <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crate/core Issues and features relating to the `tokio-trace-core` crate kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant