Skip to main content

RpcObserver

Trait RpcObserver 

Source
pub trait RpcObserver:
    Send
    + Sync
    + 'static {
    // Required method
    fn on_call(&self, evt: RpcCallEvent);
}
Expand description

Observer trait. The substrate calls on_call synchronously from the dispatch task on each completed RPC boundary; implementations must be cheap (the firing thread is the hot path). A push into a bounded mpsc or a lock-free ring is the expected shape.

Required Methods§

Source

fn on_call(&self, evt: RpcCallEvent)

Fired once per observed RPC boundary. Must be cheap — the dispatch thread blocks until the call returns.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§