Skip to main content

HubDispatch

Trait HubDispatch 

Source
pub trait HubDispatch: Send + Sync {
    // Required methods
    fn dispatch(
        &self,
        method: &str,
        params: Value,
    ) -> Pin<Box<dyn Stream<Item = StreamItem> + Send + 'static>>;
    fn method_names() -> &'static [&'static str]
       where Self: Sized;
    fn method_schemas() -> Vec<MethodSchema>
       where Self: Sized;
    fn method_help(&self, method: &str) -> Option<String>;
}
Expand description

Trait for types that can dispatch method calls

This is generated by #[hub_methods] on impl blocks.

Required Methods§

Source

fn dispatch( &self, method: &str, params: Value, ) -> Pin<Box<dyn Stream<Item = StreamItem> + Send + 'static>>

Dispatch a method call and return a stream of results

Source

fn method_names() -> &'static [&'static str]
where Self: Sized,

Get the list of method names

Source

fn method_schemas() -> Vec<MethodSchema>
where Self: Sized,

Get method schemas for all methods

Source

fn method_help(&self, method: &str) -> Option<String>

Get help for a specific method

Implementors§