#[hub_methods]Expand description
Attribute macro for impl blocks containing hub methods.
Generates:
- Method enum for schema extraction
- Activation trait implementation
- RPC server trait and implementation
§Attributes
namespace = "..."(required) - The activation namespaceversion = "..."(optional, default: “1.0.0”) - Version stringdescription = "..."(optional) - Activation descriptioncrate_path = "..."(optional, default: “crate”) - Path to substrate crate
§Example
ⓘ
#[hub_methods(namespace = "bash", version = "1.0.0", description = "Execute bash commands")]
impl Bash {
/// Execute a bash command and stream output
#[hub_method]
async fn execute(&self, command: String) -> impl Stream<Item = BashEvent> + Send + 'static {
self.executor.execute(&command).await
}
}