Skip to main content

RpcTransport

Trait RpcTransport 

Source
pub trait RpcTransport: Send + Sync {
    // Required methods
    fn send(&self, frame: SessionFrame);
    fn on_frame(&self, listener: Arc<dyn Fn(SessionFrame) + Send + Sync>);
}
Expand description

Wire-level transport. The tf-session crate will provide an adapter that implements this on top of SessionState; for tests we use an in-memory pair.

Required Methods§

Source

fn send(&self, frame: SessionFrame)

Source

fn on_frame(&self, listener: Arc<dyn Fn(SessionFrame) + Send + Sync>)

Register a listener; returns a key that can be used to unregister (unused here because we just store the Arc).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§