pub struct DynamicHub { /* private fields */ }Expand description
DynamicHub - an activation that routes to dynamically registered child activations
Unlike hub activations with hardcoded children (like Solar),
DynamicHub allows registering activations at runtime via .register().
§Direct Hosting
For a single activation, host it directly:
let solar = Arc::new(Solar::new());
TransportServer::builder(solar, converter).serve().await?;§Composition
For multiple top-level activations, use DynamicHub:
let hub = DynamicHub::with_namespace("myapp")
.register(Solar::new())
.register(EchoActivation::new());Implementations§
Source§impl DynamicHub
impl DynamicHub
Sourcepub fn new(namespace: impl Into<String>) -> Self
pub fn new(namespace: impl Into<String>) -> Self
Create a new DynamicHub with explicit namespace
Unlike single activations which have fixed namespaces, DynamicHub is a composition tool that can be named based on your application. Common choices:
- “hub” - generic default
- “substrate” - for substrate server
- “myapp” - for your application name
The namespace appears in method calls: {namespace}.call, {namespace}.schema
§The root name is a routing namespace, not a label
Routing resolves the hub root namespace before registered
activations, so the root name must differ from the namespace of every
activation you later register. A hub root that
shares its name with a child (DynamicHub::new("echo").register(Echo)
where Echo’s namespace is also "echo") makes every method on that
child unreachable: echo.<method> resolves to the hub root and fails
with Command not found, and navigators resolve the like-named child
back to the root schema. This is silent at construction and fatal at
call time, so register rejects the collision with
a panic. Pick a distinct root name (e.g. "echo_hub").
Z2H-8 / HOSTLESS-3 — register-time detection of the root/activation namespace shadow.
Sourcepub fn with_scope_registry(self, registry: ScopeRegistry) -> Self
pub fn with_scope_registry(self, registry: ScopeRegistry) -> Self
Configure the deployment’s ScopeRegistry — the scope gate’s
source of truth for role→scope expansion, public-method
declarations, and per-method scope overlays (R-5 / AUTHZ-CORE-4
acceptance 8).
Once a registry is configured, every dispatch through this hub
consults the gate: methods whose MethodSchema carries
requires_credential scopes (or that have a registry overlay) are
enforced; public methods bypass; methods with no declared
requirement pass through unchanged unless
DynamicHub::with_default_deny is also set.
A hub that never calls this (and never sets default_deny)
dispatches byte-for-byte as before the gate existed.
See [super::scope_gate] for the full decision table.
Sourcepub fn with_default_deny(self, default_deny: bool) -> Self
pub fn with_default_deny(self, default_deny: bool) -> Self
Set the default-deny posture (R-5 / AUTHZ-CORE-1). Ships OFF.
With it ON, methods with NO declared requirement are enforced
against the implicit full-path scope
(ScopeRegistry::required_scopes_for’s implicit rule) — fail
closed, including when no registry is configured at all. With it
OFF (the default), such methods behave exactly as today.
Open human decision (R-S01 Q4): whether / when each backend flips this ON (inside the ROLES wave’s completion gate vs left to backend epics à la AUTHZ-FLOWS-4) is unresolved. Until that call is made, no backend should enable it in production.
Deviation from AUTHZ-CORE-1: this is a runtime builder option, not
the Cargo feature flag CORE-1 pinned — see [super::scope_gate]
module docs for the rationale.
Sourcepub fn with_audit_sink(self, sink: Arc<dyn AuditSink>) -> Self
pub fn with_audit_sink(self, sink: Arc<dyn AuditSink>) -> Self
Override where the scope gate writes its ScopeCheck
AuditRecords (AUTHZ-CORE-5). Default:
plexus_auth_core::TracingAuditSink (tracing::info! events on
the plexus::audit target).
The gate awaits the sink’s write BEFORE the dispatch responds (“audit before respond”, AUTHZ-S01-output §8). Sink implementors are responsible for low-latency writes.
Sourcepub fn with_gate(self, gate: Arc<Gate>) -> Self
pub fn with_gate(self, gate: Arc<Gate>) -> Self
AUTH-2: put every call through gate before routing — default deny.
With a gate, a call runs only if the caller holds the method’s grant
(MethodSchema.grant, else <activation>.<method>) through a role
on the scope its target param resolves to — or anywhere, for a method
without a target — within the session’s ceiling. public methods run
for anyone; an anonymous caller reaches nothing else
(PlexusError::Unauthenticated); a refusal is
AuthzDenyReason::MissingGrant, rendered on the wire as an error
item with error_kind: "forbidden", grant, scope, roles,
held_on. The routed call runs with the gate’s Reach as
super::grant_gate::current_reach, which #[plexus_macros::method]
hands a method declaring reach: Reach.
A gated hub also stops merging its activations’ direct JSON-RPC
methods (<activation>.<method> registered beside <hub>.call):
they carry no auth and would pass around the gate. Every call goes
through <hub>.call.
A hub that never calls this dispatches exactly as before. R-5’s
DynamicHub::with_scope_registry / DynamicHub::with_default_deny
still apply after it when configured.
Sourcepub fn with_resource_metadata(self, url: impl Into<String>) -> Self
pub fn with_resource_metadata(self, url: impl Into<String>) -> Self
AUTH-4: the RFC 9728 protected-resource metadata URL
(…/.well-known/oauth-protected-resource, AUTH-6) an anonymous
caller’s _info names as auth.resource_metadata. Only a gated hub
says it; without a gate _info is unchanged.
Sourcepub fn with_signed_in_grants<I, S>(self, grants: I) -> Self
pub fn with_signed_in_grants<I, S>(self, grants: I) -> Self
AUTH-4/AUTH-5: grants every signed-in caller reaches whatever its
roles or ceiling — admitted by the gate like a public method, but
only with a principal, and shown in every caller’s view.
DynamicHub::with_auth sets the auth activation’s whoami,
logout and requires; a hub calls this only for a method of its
own of the same kind.
Sourcepub fn with_auth(self, setup: AuthSetup) -> Self
pub fn with_auth(self, setup: AuthSetup) -> Self
AUTH-5: mount the auth activation (super::auth_activation::AuthActivation)
and put every call through a gate built from the same stores — the
one way a service turns login on. setup carries what only the
service knows: its AuthBackend (providers, login flows, sessions,
signup’s waiting list), its editable RoleStore and
MembershipStore, and its scope Resolver.
Call it after registering the service’s own activations or
before — either way auth.requires knows every method (later
registrations are added as they come). It replaces a gate set by
DynamicHub::with_gate.
Sourcepub fn view(&self, caller: Option<&AuthContext>) -> View
pub fn view(&self, caller: Option<&AuthContext>) -> View
AUTH-4: the hub as caller may see it — what _info, the hub’s
schema / hash / hashes and every <ns>.schema answer that
caller on a gated hub. Anonymous: the public methods only (the
auth activation’s door). Signed in: each method whose grant a role
the caller holds lists (within its ceiling), with held_on; the
public methods; the signed-in methods (auth.whoami, …). Methods
the caller cannot use are absent; activations left with none are
absent. The hub’s own methods are in every view.
Without a gate: the whole hub, as every caller sees it today
(ViewKind::Caller, the hub’s own hash).
See super::view.
PERF-15: answered from the service’s self-description cache — built once per schema generation and, for a gated service, once per view key (the caller’s grants’ fingerprint, or anonymous) and grants generation.
Sourcepub fn schema_moved(&self)
pub fn schema_moved(&self)
PERF-15: something this service describes changed after it was built
— a child mounted or gone while it serves, an activation whose schema
changed: what the self-description cache kept is dropped, and the
next _info, hash or schema builds it again. Registering, and
every other change while the service is built, does this by itself.
Sourcepub fn info(&self, caller: Option<&AuthContext>) -> Value
pub fn info(&self, caller: Option<&AuthContext>) -> Value
AUTH-4: _info’s content for caller. Without a gate, exactly
today’s {backend, auth_capabilities} whoever asks. With one, also
view (anonymous | caller) and view_hash; and, to an
anonymous caller, auth: {methods: [the public methods' grants], resource_metadata?} — how to sign in.
Sourcepub async fn service_ir(
&self,
namespaces: &[String],
caller: Option<&AuthContext>,
) -> Result<ServiceIr, IrError>
pub async fn service_ir( &self, namespaces: &[String], caller: Option<&AuthContext>, ) -> Result<ServiceIr, IrError>
RETURNS-40: the service’s IR of the walks from namespaces (dotted
paths; none: the whole service) as caller sees it — what its ir
method answers. Synapse’s walk, made in process over one snapshot
of what the caller is shown (RETURNS-40 review #2): the service’s own
schema and each activation’s from that one view (a grant that moves
while the IR is built moves the next view, not this one), a static
child’s as its activation answers it, each child summary followed;
under the R-5 scope gate only the schemas the caller’s own calls are
answered (#3). Built off the runtime (spawn_blocking), once per key
at a time, and kept by the view’s hash, the roots and — under the
scope gate — what the caller is answered (super::ir::IrCache,
#4); a refusal is not kept. The IR is super::ir::build’s, equal
to synapse’s buildIRFromSchemas over the same schemas.
Sourcepub fn ir_builds(&self) -> usize
pub fn ir_builds(&self) -> usize
How many IR builds this service has run — its ir answers built
rather than kept.
Sourcepub fn declared_roles(&self) -> BTreeMap<String, Vec<String>>
pub fn declared_roles(&self) -> BTreeMap<String, Vec<String>>
AUTH-2/AUTH-3: the default roles every registered activation
declares (#[plexus_macros::activation(roles(...))]), merged by role
name — what a service seeds its Roles with
(RoleTable::from_lists) before an admin’s edits.
Sourcepub fn static_children(&self) -> Vec<PluginSchema>
pub fn static_children(&self) -> Vec<PluginSchema>
MACRO-20: every registered activation’s static children (and
theirs), each a schema whose namespace is its whole path
(tickets.commits) and whose grants and roles are qualified by it —
see super::children. Empty for a hub whose activations have no
static #[plexus_macros::child].
Sourcepub fn scope_registry(&self) -> Option<&ScopeRegistry>
pub fn scope_registry(&self) -> Option<&ScopeRegistry>
Read-only view of the configured ScopeRegistry, if any.
Test-side accessor.
Sourcepub fn slot_children(&self) -> (Vec<PluginSchema>, Vec<String>)
pub fn slot_children(&self) -> (Vec<PluginSchema>, Vec<String>)
NEST-5: every slot of every registered activation and static child
(to any depth): each typed slot as a schema at its path
(tickets.{item}, grants qualified — super::slots), and each
untyped slot’s path.
Sourcepub fn described_children(&self) -> Vec<PluginSchema>
pub fn described_children(&self) -> Vec<PluginSchema>
MACRO-20 and NEST-5: every static child and every typed slot, each a
schema whose namespace is its whole path and whose grants are
qualified by it — what the gate, the roles, auth.requires and the
caller’s view read below an activation.
Sourcepub fn with_forward_policy(
self,
callee_ns: impl Into<String>,
policy: Arc<dyn ForwardPolicy>,
) -> Self
pub fn with_forward_policy( self, callee_ns: impl Into<String>, policy: Arc<dyn ForwardPolicy>, ) -> Self
Register a plexus_auth_core::ForwardPolicy for a callee
namespace.
AUTHLANG-3 — every cross-boundary call through this hub consults
the registry at dispatch time. When callee_ns has no entry, the
framework falls back to plexus_auth_core::IdentityOnly.
AUTHLANG-4’s #[plexus::activation(forward_policy = ...)]
attribute is the declarative path; this builder is the imperative
escape hatch used by integration tests and hand-rolled wiring.
§Example
use plexus_auth_core::PassThrough;
use std::sync::Arc;
let hub = DynamicHub::new("my-backend")
.with_forward_policy("solar", Arc::new(PassThrough));Sourcepub fn forward_policies(&self) -> &ForwardPolicyRegistry
pub fn forward_policies(&self) -> &ForwardPolicyRegistry
Read-only view of the registered forward policies.
Test-side accessor; production dispatch consults the registry via
the ChildRouter::forward_policy_for override.
Sourcepub fn with_auth_capabilities(self, caps: BackendAuthCapabilities) -> Self
pub fn with_auth_capabilities(self, caps: BackendAuthCapabilities) -> Self
Declare the backend’s authentication capabilities, served at _info.
Backends call this at builder time to advertise which auth mechanisms they support (Bearer, Cookie, OIDC, Anonymous). Generic clients (synapse CLI, gamma, generated SDKs) read the advertisement to decide which authentication flow to drive.
Without calling this method, _info emits the
plexus_auth_core::BackendAuthCapabilities::anonymous_default
fallback: a single Anonymous mechanism, no default. This preserves
today’s no-auth substrate behavior.
Per AUTHZ-CORE-3 / AUTHZ-S01-output §2.
§Example
use plexus_auth_core::{
AuthMechanism, BackendAuthCapabilities, CookieName, MethodPath,
};
let caps = BackendAuthCapabilities::new(
vec![AuthMechanism::Cookie {
cookie: CookieName::try_new("plexus_session").unwrap(),
login: MethodPath::try_new("auth.login").unwrap(),
refresh: None,
logout: None,
}],
Some(0),
)
.unwrap();
let hub = DynamicHub::new("my-backend").with_auth_capabilities(caps);Sourcepub fn auth_capabilities(&self) -> Option<&BackendAuthCapabilities>
pub fn auth_capabilities(&self) -> Option<&BackendAuthCapabilities>
Returns the configured BackendAuthCapabilities, or None if the
backend has not called Self::with_auth_capabilities.
Test-side accessor; production code reads the advertisement off _info.
Sourcepub fn with_namespace(namespace: impl Into<String>) -> Self
👎Deprecated since 0.3.0: Use DynamicHub::new(namespace) instead
pub fn with_namespace(namespace: impl Into<String>) -> Self
Use DynamicHub::new(namespace) instead
Deprecated: Use new() with explicit namespace instead
Sourcepub fn runtime_namespace(&self) -> &str
pub fn runtime_namespace(&self) -> &str
Get the runtime namespace for this DynamicHub instance
Sourcepub fn registry(&self) -> RwLockReadGuard<'_, PluginRegistry>
pub fn registry(&self) -> RwLockReadGuard<'_, PluginRegistry>
Get access to the activation registry
Sourcepub fn register<A: Activation + ChildRouter + Clone + 'static>(
self,
activation: A,
) -> Self
pub fn register<A: Activation + ChildRouter + Clone + 'static>( self, activation: A, ) -> Self
Sourcepub fn register_hub<A: Activation + ChildRouter + Clone + 'static>(
self,
activation: A,
) -> Self
👎Deprecated since 0.5.0: Use register() — it now handles both leaf and hub activations
pub fn register_hub<A: Activation + ChildRouter + Clone + 'static>( self, activation: A, ) -> Self
Use register() — it now handles both leaf and hub activations
Register a hub activation that supports nested routing
Hub activations implement ChildRouter, enabling direct nested method calls
like hub.solar.mercury.info at the RPC layer (no hub.call indirection).
§Panics
Same contract as Self::register: panics on a root/activation
namespace collision (Z2H-8 / HOSTLESS-3).
Sourcepub fn root(&self) -> ServiceRoot
pub fn root(&self) -> ServiceRoot
NEST-15: the service root — its table of peers, read and changed while the service serves.
Sourcepub fn config(&self) -> Config
pub fn config(&self) -> Config
NEST-21: the service’s configuration — a capability handle (every
clone the same store), made in memory at its first use unless
DynamicHub::with_config gave one. Hand it to what reads or sets
a setting; serve it with DynamicHub::with_config_service.
Sourcepub fn with_config(self, config: Config) -> Self
pub fn with_config(self, config: Config) -> Self
NEST-21: keep the configuration in config (one with a file, or one
a host built before the service). Before the service is shared.
Sourcepub fn with_config_service(self) -> Self
pub fn with_config_service(self) -> Self
NEST-21: serve the service’s configuration as the config
activation (super::config::ConfigActivation): admin’s, each key
on its own grant.
Sourcepub fn notices(&self) -> Receiver<Notice>
pub fn notices(&self) -> Receiver<Notice>
NEST-16: what children say through host.notify from now on (the
last 64 kept for a slow listener; older ones dropped for it).
Sourcepub fn notify(&self, notice: Notice) -> u64
pub fn notify(&self, notice: Notice) -> u64
NEST-16: say notice to whoever listens; answers how many do.
Sourcepub fn method_at(&self, path: &str) -> Option<(String, String)>
pub fn method_at(&self, path: &str) -> Option<(String, String)>
NEST-16: the method this service serves at path (shop.items,
shop.ui.slots.list, <service>.schema): its shape hash
(super::peer::Interface::method_hash) and its grant. Every
registered activation, mounted child, static child and typed slot’s
method; None for anything else.
Sourcepub fn check_needs(&self, child: &str, needs: &[Need]) -> Result<(), NeedsMiss>
pub fn check_needs(&self, child: &str, needs: &[Need]) -> Result<(), NeedsMiss>
NEST-16: check a graft’s needs against what this service serves,
each by its shape hash.
Sourcepub fn check_grafts(&self) -> Result<(), Vec<NeedsMiss>>
pub fn check_grafts(&self) -> Result<(), Vec<NeedsMiss>>
NEST-16: check every entry that declares needs against the rest of
the service — what serving a service does first (a static graft whose
parent is not there is refused before anything is served).
Sourcepub fn list_methods(&self) -> Vec<String>
pub fn list_methods(&self) -> Vec<String>
List all methods across all activations
Sourcepub fn list_activations_info(&self) -> Vec<ActivationInfo>
pub fn list_activations_info(&self) -> Vec<ActivationInfo>
List all activations (including this hub itself)
Sourcepub fn compute_hash(&self) -> String
pub fn compute_hash(&self) -> String
Compute hash for cache invalidation
Returns the hash from the recursive plugin schema. This hash changes
whenever any method definition or child plugin changes — and,
PERF-21, only then: the children are listed by namespace, so every
start of the same build computes the same hash (the plexus_hash
every item carries, PlexusContext::init).
Sourcepub async fn route(
&self,
method: &str,
params: Value,
auth: Option<&AuthContext>,
) -> Result<PlexusStream, PlexusError>
pub async fn route( &self, method: &str, params: Value, auth: Option<&AuthContext>, ) -> Result<PlexusStream, PlexusError>
Route a call to the appropriate activation
Sourcepub async fn route_with_ctx(
&self,
method: &str,
params: Value,
auth: Option<&AuthContext>,
raw_ctx: Option<&RawRequestContext>,
) -> Result<PlexusStream, PlexusError>
pub async fn route_with_ctx( &self, method: &str, params: Value, auth: Option<&AuthContext>, raw_ctx: Option<&RawRequestContext>, ) -> Result<PlexusStream, PlexusError>
Route a call to the appropriate activation, with optional raw HTTP request context.
NEST-11: the call is routed knowing its service — the outermost
service a call entered — so a child mounted below it
(RemoteChild) can take the calls its far side
makes back under a forwarded call through this service’s own routing
and gate (super::service_scope).
Sourcepub fn downgrade(&self) -> WeakService
pub fn downgrade(&self) -> WeakService
NEST-11: a weak handle to this service — what a child mounted below it keeps, so a child never keeps its service alive.
Sourcepub fn derived_site_hint(&self) -> Option<AttachmentSite>
pub fn derived_site_hint(&self) -> Option<AttachmentSite>
CA-1: the AttachmentSite implied by this backend’s advertised
auth capabilities, or None when no capabilities are configured or
none of the advertised mechanisms implies a site.
Sourcepub async fn do_resolve_handle(
&self,
handle: &Handle,
) -> Result<PlexusStream, PlexusError>
pub async fn do_resolve_handle( &self, handle: &Handle, ) -> Result<PlexusStream, PlexusError>
Resolve a handle using the activation registry
Looks up the activation by its UUID in the registry.
Sourcepub fn get_activation_schema(&self, namespace: &str) -> Option<Schema>
pub fn get_activation_schema(&self, namespace: &str) -> Option<Schema>
Get activation schema
Sourcepub fn registry_snapshot(&self) -> PluginRegistrySnapshot
pub fn registry_snapshot(&self) -> PluginRegistrySnapshot
Get a snapshot of the activation registry (safe to use outside locks)
Sourcepub fn lookup_plugin(&self, id: Uuid) -> Option<String>
pub fn lookup_plugin(&self, id: Uuid) -> Option<String>
Look up an activation path by its UUID
Sourcepub fn lookup_plugin_by_path(&self, path: &str) -> Option<Uuid>
pub fn lookup_plugin_by_path(&self, path: &str) -> Option<Uuid>
Look up an activation UUID by its path
Sourcepub fn list_plugin_schemas(&self) -> Vec<PluginSchema>
pub fn list_plugin_schemas(&self) -> Vec<PluginSchema>
Get activation schemas for all activations (including this hub itself)
Sourcepub fn list_full_schemas(&self) -> Vec<PluginSchema>
👎Deprecated: Use list_plugin_schemas instead
pub fn list_full_schemas(&self) -> Vec<PluginSchema>
Use list_plugin_schemas instead
Deprecated: use list_plugin_schemas instead
Sourcepub fn get_method_help(&self, method: &str) -> Option<String>
pub fn get_method_help(&self, method: &str) -> Option<String>
Get help for a method
Sourcepub fn plugin_children(&self) -> Vec<ChildSummary>
pub fn plugin_children(&self) -> Vec<ChildSummary>
Get child activation summaries: one per registered activation, in
namespace order (PERF-21) — the service schema’s children, which
its hash and every caller’s view hash digest in this order.
Called by #[plexus_macros::activation] when its hub flag is set.
Sourcepub fn into_rpc_module(self) -> Result<RpcModule<()>, RegisterMethodError>
pub fn into_rpc_module(self) -> Result<RpcModule<()>, RegisterMethodError>
Convert to RPC module
Sourcepub fn serve_call(
&self,
params: Params<'static>,
pending: PendingSubscriptionSink,
ext: Extensions,
ns: &'static str,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send>>
pub fn serve_call( &self, params: Params<'static>, pending: PendingSubscriptionSink, ext: Extensions, ns: &'static str, ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send>>
V2-57: serve one {ns}.call exactly as this service’s own {ns}.call
does: routed as the connection’s caller (the AuthContext the upgrade
put in ext), a method with an Input taking its input half from
pending (BIDIR-6), each item piped, a dispatch error sent as an
item. For a host that registers {ns}.call itself to check its own
limits first (menger’s call layer): it removes the module’s
{ns}.call, registers its own, and hands each call it admits here.
Routing with route instead runs outside the call’s
seam, so an Input method answers that the transport carries none.
ns is the service’s runtime namespace, the error items’ source.
Sourcepub fn arc_into_rpc_module(
hub: Arc<Self>,
) -> Result<RpcModule<()>, RegisterMethodError>
pub fn arc_into_rpc_module( hub: Arc<Self>, ) -> Result<RpcModule<()>, RegisterMethodError>
Convert Arc
Unlike into_rpc_module, this keeps the Arc
Trait Implementations§
Source§impl Activation for DynamicHub
impl Activation for DynamicHub
type Methods = DynamicHubMethod
fn namespace(&self) -> &str
fn version(&self) -> &str
Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§fn long_description(&self) -> Option<&str>
fn long_description(&self) -> Option<&str>
fn methods(&self) -> Vec<&str>
fn method_help(&self, method: &str) -> Option<String>
fn call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
auth: Option<&'life2 AuthContext>,
raw_ctx: Option<&'life3 RawRequestContext>,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn into_rpc_methods(self) -> Methods
Source§fn plugin_schema(&self) -> PluginSchema
fn plugin_schema(&self) -> PluginSchema
Source§fn slot_schema() -> Option<PluginSchema>where
Self: Sized,
fn slot_schema() -> Option<PluginSchema>where
Self: Sized,
#[child] publishes as its slot’s type
(MethodRole::DynamicChild { child }). None (the default) for an
activation the macro did not write; #[plexus_macros::activation]
emits it (its static namespace, version, description, methods and
roles).Source§fn plugin_id(&self) -> Uuid
fn plugin_id(&self) -> Uuid
fn resolve_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
_handle: &'life1 Handle,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn static_child_schemas(&self) -> Vec<(String, PluginSchema)>
fn static_child_schemas(&self) -> Vec<(String, PluginSchema)>
(path, schema) — the same list as
ChildRouter::router_static_child_schemas, reachable from the
hub’s type-erased registry (which holds Activations). Read moreSource§impl ChildRouter for DynamicHub
ChildRouter implementation for DynamicHub
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
Source§fn forward_policy_for(&self, callee_ns: &str) -> Option<Arc<dyn ForwardPolicy>>
fn forward_policy_for(&self, callee_ns: &str) -> Option<Arc<dyn ForwardPolicy>>
AUTHLANG-3 — consult the hub’s
ForwardPolicyRegistry.
Source§fn router_namespace(&self) -> &str
fn router_namespace(&self) -> &str
Source§fn router_call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
auth: Option<&'life2 AuthContext>,
raw_ctx: Option<&'life3 RawRequestContext>,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn router_call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
auth: Option<&'life2 AuthContext>,
raw_ctx: Option<&'life3 RawRequestContext>,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn peer_child<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn ChildRouter>>, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn peer_child<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn ChildRouter>>, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
name, or why a peer could not be
returned — what routing asks, so a caller gets a typed error item
(not_grafted, unavailable, shape_mismatch, …), never “not
found”, for a peer that failed. Default: Self::get_child, which
cannot fail. #[plexus_macros::activation] overrides it for an
activation with a #[plexus_macros::peer] slot.Source§fn capabilities(&self) -> ChildCapabilities
fn capabilities(&self) -> ChildCapabilities
Source§fn list_children<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<BoxStream<'_, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_children<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<BoxStream<'_, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn search_children<'life0, 'life1, 'async_trait>(
&'life0 self,
_query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<BoxStream<'_, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_children<'life0, 'life1, 'async_trait>(
&'life0 self,
_query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<BoxStream<'_, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn router_schema(&self) -> Option<PluginSchema>
fn router_schema(&self) -> Option<PluginSchema>
Source§fn router_static_child_schemas(&self) -> Vec<(String, PluginSchema)>
fn router_static_child_schemas(&self) -> Vec<(String, PluginSchema)>
(path, schema) — path relative to this router, dotted for a
grandchild ("commits", "commits.audit"), schema the child’s own
(its methods’ grants and its roles relative to it, as its macro
wrote them). Read moreSource§fn framework_stamped_principal(&self) -> Principal
fn framework_stamped_principal(&self) -> Principal
plexus_auth_core::Principal of
this router. Read moreSource§impl Clone for DynamicHub
impl Clone for DynamicHub
Source§impl DynamicHubRpcServer for DynamicHub
impl DynamicHubRpcServer for DynamicHub
Source§fn call<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
method: String,
params: Option<Value>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
method: String,
params: Option<Value>,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn hash<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn hash<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn hashes<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn hashes<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for DynamicHub
impl !UnwindSafe for DynamicHub
impl Forget for DynamicHub
impl Freeze for DynamicHub
impl Move for DynamicHub
impl Send for DynamicHub
impl Sync for DynamicHub
impl Unpin for DynamicHub
impl UnsafeUnpin for DynamicHub
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSendSync for T
Source§impl<T> Peer for Twhere
T: Activation + ChildRouter,
impl<T> Peer for Twhere
T: Activation + ChildRouter,
Source§fn call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
auth: Option<&'life2 AuthContext>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = PlexusStreamItem> + Send>>, PlexusError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
T: 'async_trait,
fn call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
auth: Option<&'life2 AuthContext>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = PlexusStreamItem> + Send>>, PlexusError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
T: 'async_trait,
repos, or a path below it: child.m).