pub fn subscribe_fn<F>(
registry: Arc<SubscriptionRegistry>,
source_name: String,
source_id: u32,
config: SubscriptionConfig,
f: F,
) -> CallbackSubscriptionHandleExpand description
Creates a closure-based subscription (convenience wrapper).
Equivalent to subscribe_callback with a closure wrapped in an internal
adapter that implements SubscriptionCallback.
§Example
ⓘ
let handle = subscribe_fn(registry, "trades".into(), 0, config, |event| {
println!("Got: {:?}", event.event_type());
});