Skip to content

Adding a "close" method to {Future,Stream}[Producer,Consumer} traits #12091

@alexcrichton

Description

@alexcrichton

@dicej in the fuzzer I'm writing I'm finding that it's difficult to know when a producer/consumer is dropped by the guest in the host. Currently this is only detect-able via Drop for MyThing which works well enough, but I was wondering if it would be viable to add a fn close(...) method on the traits? The trait method would take a StoreContextMut<D> which would enable updating store state on close which would be convenient. Is this easy enough to slot in to the implementation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions