Skip to main content

ExtensionGateway

Struct ExtensionGateway 

Source
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

Source

pub fn new() -> Self

Create a new extension gateway

Source

pub fn with_config(config: GatewayConfig) -> Self

Create a new extension gateway with configuration

Source

pub fn subscribe(&self) -> Receiver<GatewayEvent>

Subscribe to gateway events

Source

pub async fn register_service( &self, request: ServiceRegistrationRequest, ) -> Result<ServiceId, GatewayError>

Register a new extension service

Source

pub async fn unregister_service( &self, service_id: &ServiceId, ) -> Result<(), GatewayError>

Unregister a service

Source

pub async fn execute_tool( &self, tool_name: &str, params: JsonValue, request_id: JsonRpcId, ) -> Result<ToolRouteResult, GatewayError>

Execute a tool

Source

pub async fn execute_node( &self, node_id: &str, context: NodeContext, request_id: JsonRpcId, required_capabilities: Vec<NodeCapability>, ) -> Result<NodeRouteResult, GatewayError>

Execute a node

Source

pub async fn handle_callback( &self, request: JsonRpcRequest, ) -> Result<CallbackResult, GatewayError>

Handle a callback request

Source

pub async fn list_services(&self) -> Vec<ExtensionService>

List all services

Source

pub async fn get_service( &self, service_id: &ServiceId, ) -> Option<ExtensionService>

Get service by ID

Source

pub async fn get_service_by_name(&self, name: &str) -> Option<ExtensionService>

Get service by name

Source

pub async fn list_tools(&self) -> Vec<ToolDefinition>

List all tools

Source

pub async fn list_nodes(&self) -> Vec<NodeDefinition>

List all nodes

Source

pub async fn has_tool(&self, tool_name: &str) -> bool

Check if tool exists

Source

pub async fn has_node(&self, node_id: &str) -> bool

Check if node exists

Source

pub async fn registry_stats(&self) -> RegistryStats

Get registry statistics

Source

pub async fn gateway_stats(&self) -> GatewayStats

Get gateway statistics

Source

pub async fn health_check(&self) -> Vec<ServiceId>

Health check all services

Source

pub async fn heartbeat( &self, service_id: &ServiceId, ) -> Result<(), GatewayError>

Send heartbeat for a service

Source

pub async fn get_service_status( &self, service_id: &ServiceId, ) -> Option<ServiceStatus>

Get service status

Source

pub async fn stop_all(&self)

Stop all services

Source

pub fn create_error_response( &self, error: GatewayError, id: JsonRpcId, ) -> JsonRpcResponse

Create JSON-RPC error response

Source

pub fn registry(&self) -> Arc<RegistryService>

Get the registry service

Source

pub fn lifecycle(&self) -> Arc<LifecycleManager>

Get the lifecycle manager

Source

pub fn tool_router(&self) -> Arc<ToolRouter>

Get the tool router

Source

pub fn node_router(&self) -> Arc<NodeRouter>

Get the node router

Source

pub fn callback(&self) -> Arc<CallbackHandler>

Get the callback handler

Source

pub fn security(&self) -> Arc<SecurityValidator>

Get the security validator

Trait Implementations§

Source§

impl Default for ExtensionGateway

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more