Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

observer_fn

crates.io ci codecov license

Define observers from callbacks: FnObserver (static dispatch) and DynFnObserver (dynamic dispatch).

See Also

Example

cargo run -p rx_core --example observer_fn_example
let _subscription = just("world").subscribe(FnObserver::new(
  |next| println!("hello: {next}"),
  |_error| println!("error"),
  || {},
));

Output:

hello: world