fidl_fuchsia_net_routes_ext

Function event_stream_from_state_with_options

Source
pub fn event_stream_from_state_with_options<I: FidlRouteIpExt>(
    routes_state: &<I::StateMarker as ProtocolMarker>::Proxy,
    options: WatcherOptions,
) -> Result<impl Stream<Item = Result<Event<I>, WatchError>>, WatcherCreationError>
Expand description

Connects to the watcher protocol with WatcherOptions and converts the Hanging-Get style API into an Event stream.

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.