fidl_fuchsia_net_routes_ext::rules

Function rule_event_stream_from_watcher

Source
pub fn rule_event_stream_from_watcher<I: FidlRuleIpExt>(
    watcher: <I::RuleWatcherMarker as ProtocolMarker>::Proxy,
) -> Result<impl Stream<Item = Result<RuleEvent<I>, RuleWatchError>>, WatcherCreationError>
Expand description

Turns the provided watcher client into a RuleEvent stream by applying Hanging-Get watch.

Each call to Watch returns a batch of events, which are flattened into a single stream. If an error is encountered while calling Watch or while converting the event, the stream is immediately terminated.