Skip to main content

ChildRouter

Trait ChildRouter 

Source
pub trait ChildRouter: Send + Sync {
    // Required methods
    fn router_namespace(&self) -> &str;
    fn router_call<'life0, 'life1, 'async_trait>(
        &'life0 self,
        method: &'life1 str,
        params: Value,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = PlexusStreamItem> + Send>>, PlexusError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn get_child<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Option<Box<dyn ChildRouter>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}
Expand description

Trait for activations that can route to child activations

Hub activations implement this to support nested method routing. When a method like “mercury.info” is called on a solar activation, this trait enables routing to the mercury child.

This trait is separate from Activation to avoid associated type issues with dynamic dispatch.

Required Methods§

Source

fn router_namespace(&self) -> &str

Get the namespace of this router (for error messages)

Source

fn router_call<'life0, 'life1, 'async_trait>( &'life0 self, method: &'life1 str, params: Value, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = PlexusStreamItem> + Send>>, PlexusError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Call a method on this router

Source

fn get_child<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn ChildRouter>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get a child activation instance by name for nested routing

Implementations on Foreign Types§

Source§

impl ChildRouter for HyperforgeHub

ChildRouter implementation for nested method routing

Source§

fn router_namespace(&self) -> &str

Source§

fn router_call<'life0, 'life1, 'async_trait>( &'life0 self, method: &'life1 str, params: Value, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = PlexusStreamItem> + Send>>, PlexusError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, HyperforgeHub: 'async_trait,

Source§

fn get_child<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn ChildRouter>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, HyperforgeHub: 'async_trait,

Source§

impl ChildRouter for RepoHub

Source§

fn router_namespace(&self) -> &str

Source§

fn router_call<'life0, 'life1, 'async_trait>( &'life0 self, method: &'life1 str, params: Value, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = PlexusStreamItem> + Send>>, PlexusError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, RepoHub: 'async_trait,

Source§

fn get_child<'life0, 'life1, 'async_trait>( &'life0 self, _name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn ChildRouter>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, RepoHub: 'async_trait,

Source§

impl ChildRouter for WorkspaceHub

Source§

fn router_namespace(&self) -> &str

Source§

fn router_call<'life0, 'life1, 'async_trait>( &'life0 self, method: &'life1 str, params: Value, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = PlexusStreamItem> + Send>>, PlexusError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, WorkspaceHub: 'async_trait,

Source§

fn get_child<'life0, 'life1, 'async_trait>( &'life0 self, _name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn ChildRouter>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, WorkspaceHub: 'async_trait,

Implementors§

Source§

impl ChildRouter for Solar

ChildRouter implementation for nested method routing

This enables calls like solar.mercury.info to route through Solar → Mercury → info method.

Source§

impl ChildRouter for DynamicHub

ChildRouter implementation for DynamicHub

This enables nested routing through registered activations. e.g., hub.call(“solar.mercury.info”) routes to solar → mercury → info