Skip to content

API design change proposal #13

@gustafla

Description

@gustafla

This week I been papering over the RocketClient with a new simple API as you may have seen. It's starting to work very well for my upcoming Graffathon entry's engine, but the module has gotten rather complicated, partly due to the current client API design.

I started thinking, what if we make both the "low level" RocketClient and the RocketPlayer no longer own the tracks but work on borrowed tracks instead? This would make it easier to keep track state stashed somewhere else but also cleanly represent a "not connected" state by wrapping the client in an Option.

The design change would also make RocketClient::save_tracks redundant and we should remove it. It's already named confusingly because it's not saving anything, just borrowing a reference to internal track state.

The function signatures would have to change to take a &Tracks or &mut Tracks where needed, and some references to self could probably also be removed (I'm thinking get_track mostly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions