Skip to main content

SubscriptionDispatcher

Trait SubscriptionDispatcher 

pub trait SubscriptionDispatcher:
    Clone
    + Send
    + Sync
    + 'static {
    // Required method
    fn open(
        &self,
        request: SubscriptionOpen,
    ) -> impl Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Value, CratestackError>> + Send>>, CratestackError>> + Send;
}
Expand description

Opens subscriptions by op id. Implemented by generated code (one impl per schema); called by every subscription binding.

Shaped like crate::AuthProvider: implement open as a plain async fn. Returning Err refuses the subscription before the binding tells the client it is ready, so policy refusals and setup failures (“room not found”) never look like a mid-stream error.

Required Methods§

fn open( &self, request: SubscriptionOpen, ) -> impl Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Value, CratestackError>> + Send>>, CratestackError>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§