Skip to content

Feature request: Sender::send_with #2057

Open
@Lucretiel

Description

@Lucretiel

In a library I'm working on, I collect a series of one shot Senders and send clones of a final result value to each of them. I'd obviously like to avoid cloning if unnecessary, when the Receiver had been closed or dropped. I'd therefore like to request a method with this signature:

fn send_with(self, value: impl FnOnce() -> T) -> Result<(), ()>

Where the value function is only called if a receiver is listening.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions