pub trait HubDispatch: Send + Sync {
// Required methods
fn dispatch(
&self,
method: &str,
params: Value,
) -> Pin<Box<dyn Stream<Item = StreamItem> + Send>>;
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§
Sourcefn dispatch(
&self,
method: &str,
params: Value,
) -> Pin<Box<dyn Stream<Item = StreamItem> + Send>>
fn dispatch( &self, method: &str, params: Value, ) -> Pin<Box<dyn Stream<Item = StreamItem> + Send>>
Dispatch a method call and return a stream of results
Sourcefn method_names() -> &'static [&'static str]where
Self: Sized,
fn method_names() -> &'static [&'static str]where
Self: Sized,
Get the list of method names
Sourcefn method_schemas() -> Vec<MethodSchema>where
Self: Sized,
fn method_schemas() -> Vec<MethodSchema>where
Self: Sized,
Get method schemas for all methods
Sourcefn method_help(&self, method: &str) -> Option<String>
fn method_help(&self, method: &str) -> Option<String>
Get help for a specific method