Expand description
Plexus RPC Method Macro
Proc macro for defining Plexus RPC methods where the function signature IS the schema.
§Example
ⓘ
use hub_macro::{hub_methods, hub_method};
#[hub_methods(namespace = "bash", version = "1.0.0")]
impl Bash {
/// Execute a bash command
#[hub_method]
async fn execute(&self, command: String) -> impl Stream<Item = BashEvent> {
// implementation
}
}The macro extracts:
- Method name from function name
- Description from doc comments
- Input schema from parameter types
- Return type schema from Stream Item type
Attribute Macros§
- activation
- Attribute macro for impl blocks defining a Plexus activation.
- hub_
method Deprecated - Deprecated: use
plexus::methodinstead. - hub_
methods Deprecated - Deprecated: use
plexus::activationinstead. - method
- Attribute macro for individual methods within a
#[plexus::activation]impl block.
Derive Macros§
- Handle
Enum - Derive macro for type-safe handle creation and parsing.
- Plexus
Request - Derive macro for typed HTTP/WebSocket request extraction.
- Stream
Event Deprecated - DEPRECATED: This derive macro is no longer needed.