pub struct ExtensionGateway { /* private fields */ }Expand description
Extension Gateway
Unified entry point for the MatrixRPC extension system. Coordinates all components: Registry, Lifecycle, Router, and Callback.
Implementations§
Source§impl ExtensionGateway
impl ExtensionGateway
Sourcepub fn with_config(config: GatewayConfig) -> Self
pub fn with_config(config: GatewayConfig) -> Self
Create a new extension gateway with configuration
Sourcepub fn subscribe(&self) -> Receiver<GatewayEvent>
pub fn subscribe(&self) -> Receiver<GatewayEvent>
Subscribe to gateway events
Sourcepub async fn register_service(
&self,
request: ServiceRegistrationRequest,
) -> Result<ServiceId, GatewayError>
pub async fn register_service( &self, request: ServiceRegistrationRequest, ) -> Result<ServiceId, GatewayError>
Register a new extension service
Sourcepub async fn unregister_service(
&self,
service_id: &ServiceId,
) -> Result<(), GatewayError>
pub async fn unregister_service( &self, service_id: &ServiceId, ) -> Result<(), GatewayError>
Unregister a service
Sourcepub async fn execute_tool(
&self,
tool_name: &str,
params: JsonValue,
request_id: JsonRpcId,
) -> Result<ToolRouteResult, GatewayError>
pub async fn execute_tool( &self, tool_name: &str, params: JsonValue, request_id: JsonRpcId, ) -> Result<ToolRouteResult, GatewayError>
Execute a tool
Sourcepub async fn execute_node(
&self,
node_id: &str,
context: NodeContext,
request_id: JsonRpcId,
required_capabilities: Vec<NodeCapability>,
) -> Result<NodeRouteResult, GatewayError>
pub async fn execute_node( &self, node_id: &str, context: NodeContext, request_id: JsonRpcId, required_capabilities: Vec<NodeCapability>, ) -> Result<NodeRouteResult, GatewayError>
Execute a node
Sourcepub async fn handle_callback(
&self,
request: JsonRpcRequest,
) -> Result<CallbackResult, GatewayError>
pub async fn handle_callback( &self, request: JsonRpcRequest, ) -> Result<CallbackResult, GatewayError>
Handle a callback request
Sourcepub async fn list_services(&self) -> Vec<ExtensionService>
pub async fn list_services(&self) -> Vec<ExtensionService>
List all services
Sourcepub async fn get_service(
&self,
service_id: &ServiceId,
) -> Option<ExtensionService>
pub async fn get_service( &self, service_id: &ServiceId, ) -> Option<ExtensionService>
Get service by ID
Sourcepub async fn get_service_by_name(&self, name: &str) -> Option<ExtensionService>
pub async fn get_service_by_name(&self, name: &str) -> Option<ExtensionService>
Get service by name
Sourcepub async fn list_tools(&self) -> Vec<ToolDefinition>
pub async fn list_tools(&self) -> Vec<ToolDefinition>
List all tools
Sourcepub async fn list_nodes(&self) -> Vec<NodeDefinition>
pub async fn list_nodes(&self) -> Vec<NodeDefinition>
List all nodes
Sourcepub async fn registry_stats(&self) -> RegistryStats
pub async fn registry_stats(&self) -> RegistryStats
Get registry statistics
Sourcepub async fn gateway_stats(&self) -> GatewayStats
pub async fn gateway_stats(&self) -> GatewayStats
Get gateway statistics
Sourcepub async fn health_check(&self) -> Vec<ServiceId>
pub async fn health_check(&self) -> Vec<ServiceId>
Health check all services
Sourcepub async fn heartbeat(
&self,
service_id: &ServiceId,
) -> Result<(), GatewayError>
pub async fn heartbeat( &self, service_id: &ServiceId, ) -> Result<(), GatewayError>
Send heartbeat for a service
Sourcepub async fn get_service_status(
&self,
service_id: &ServiceId,
) -> Option<ServiceStatus>
pub async fn get_service_status( &self, service_id: &ServiceId, ) -> Option<ServiceStatus>
Get service status
Sourcepub fn create_error_response(
&self,
error: GatewayError,
id: JsonRpcId,
) -> JsonRpcResponse
pub fn create_error_response( &self, error: GatewayError, id: JsonRpcId, ) -> JsonRpcResponse
Create JSON-RPC error response
Sourcepub fn registry(&self) -> Arc<RegistryService> ⓘ
pub fn registry(&self) -> Arc<RegistryService> ⓘ
Get the registry service
Sourcepub fn lifecycle(&self) -> Arc<LifecycleManager> ⓘ
pub fn lifecycle(&self) -> Arc<LifecycleManager> ⓘ
Get the lifecycle manager
Sourcepub fn tool_router(&self) -> Arc<ToolRouter> ⓘ
pub fn tool_router(&self) -> Arc<ToolRouter> ⓘ
Get the tool router
Sourcepub fn node_router(&self) -> Arc<NodeRouter> ⓘ
pub fn node_router(&self) -> Arc<NodeRouter> ⓘ
Get the node router
Sourcepub fn callback(&self) -> Arc<CallbackHandler> ⓘ
pub fn callback(&self) -> Arc<CallbackHandler> ⓘ
Get the callback handler
Sourcepub fn security(&self) -> Arc<SecurityValidator> ⓘ
pub fn security(&self) -> Arc<SecurityValidator> ⓘ
Get the security validator
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ExtensionGateway
impl !UnwindSafe for ExtensionGateway
impl Freeze for ExtensionGateway
impl Send for ExtensionGateway
impl Sync for ExtensionGateway
impl Unpin for ExtensionGateway
impl UnsafeUnpin for ExtensionGateway
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more