pub trait HubContext:
Clone
+ Send
+ Sync
+ 'static {
// Required methods
fn resolve_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 Handle,
) -> 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 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;
// Provided method
fn is_valid(&self) -> bool { ... }
}Expand description
Trait for parent context that can be injected into child plugins.
This trait defines the capabilities a child plugin expects from its parent. Any hub that wants to inject context into children should implement this trait (or provide a type that implements it).
The trait is object-safe to allow dynamic dispatch when needed, though most usage will be through generic bounds.
Required Methods§
Sourcefn resolve_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 Handle,
) -> 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 resolve_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
handle: &'life1 Handle,
) -> 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,
Resolve a handle through the parent’s plugin registry.
This allows children to resolve handles from sibling plugins without knowing about them directly - they just ask the parent to route it.
Sourcefn 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 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,
Route a method call through the parent.
Enables children to call methods on sibling plugins via the parent hub.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl HubContext for Weak<DynamicHub>
HubContext implementation for Weak
impl HubContext for Weak<DynamicHub>
HubContext implementation for Weak
This enables activations to receive a weak reference to their parent DynamicHub, allowing them to resolve handles and route calls through the hub without creating reference cycles.