Skip to main content

DispatchBridge

Trait DispatchBridge 

Source
pub trait DispatchBridge: Send + Sync {
    // Required method
    fn dispatch<'a>(
        &'a self,
        subject: &'a str,
        payload: &'a Value,
    ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'a>>;
}
Expand description

Bridge that maps a GraphQL mutation dispatch to a themql-core MessageHandler call. Dyn-compatible.

Required Methods§

Source

fn dispatch<'a>( &'a self, subject: &'a str, payload: &'a Value, ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'a>>

Dispatch a command to subject with the given JSON payload.

§Errors

Returns [Error] if the dispatch fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§