Skip to main content

CommBusBackend

Trait CommBusBackend 

Source
pub trait CommBusBackend: 'static {
    type Error: Display + Debug;
    type Subscription: 'static;

    // Required methods
    fn subscribe(
        event: &str,
        callback: impl Fn(&str) + 'static,
    ) -> Result<Self::Subscription, Self::Error>;
    fn call(event: &str, data: &str) -> Result<(), Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn subscribe( event: &str, callback: impl Fn(&str) + 'static, ) -> Result<Self::Subscription, Self::Error>

Source

fn call(event: &str, data: &str) -> Result<(), Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§