Function iced::subscription::events_with
source · pub fn events_with<Message>(
f: fn(_: Event, _: Status) -> Option<Message>
) -> Subscription<Hasher, (Event, Status), Message>where
Message: 'static + MaybeSend,
Expand description
Returns a Subscription
that filters all the runtime events with the
provided function, producing messages accordingly.
This subscription will call the provided function for every Event
handled by the runtime. If the function:
- Returns
None
, theEvent
will be discarded. - Returns
Some
message, theMessage
will be produced.