Trait BackendSender

Source
pub trait BackendSender:
    Send
    + Sync
    + 'static {
    // Required method
    fn send(
        &self,
        data: &[u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), BackendError>> + Send + 'static>>;
}
Expand description

Something that can be handed bytes to send out. WHen every copy of the crate::Client is dropped, this will be too.

Required Methods§

Source

fn send( &self, data: &[u8], ) -> Pin<Box<dyn Future<Output = Result<(), BackendError>> + Send + 'static>>

Send a message to the JSON-RPC server, emitting an error if something goes wrong. The message should be serializable to a valid JSON-RPC object.

Implementors§