Skip to main content

DynamicHub

Struct DynamicHub 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn gate(&self) -> Option<&Arc<Gate>>

AUTH-2: the configured gate, if any.

Source

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.

Source

pub fn with_signed_in_grants<I, S>(self, grants: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn ir_builds(&self) -> usize

How many IR builds this service has run — its ir answers built rather than kept.

Source

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.

Source

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].

Source

pub fn scope_registry(&self) -> Option<&ScopeRegistry>

Read-only view of the configured ScopeRegistry, if any. Test-side accessor.

Source

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.

Source

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.

Source

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));
Source

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.

Source

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);
Source

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.

Source

pub fn with_namespace(namespace: impl Into<String>) -> Self

👎Deprecated since 0.3.0:

Use DynamicHub::new(namespace) instead

Deprecated: Use new() with explicit namespace instead

Source

pub fn runtime_namespace(&self) -> &str

Get the runtime namespace for this DynamicHub instance

Source

pub fn registry(&self) -> RwLockReadGuard<'_, PluginRegistry>

Get access to the activation registry

Source

pub fn register<A: Activation + ChildRouter + Clone + 'static>( self, activation: A, ) -> Self

Register an activation

§Panics

Panics if the activation’s namespace equals the hub root namespace — such a child would be unreachable at call time (Z2H-8 / HOSTLESS-3, see Self::new). Also panics if the hub has already been shared (multiple Arc references).

Source

pub 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

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).

Source

pub fn root(&self) -> ServiceRoot

NEST-15: the service root — its table of peers, read and changed while the service serves.

Source

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.

Source

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.

Source

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.

Source

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).

Source

pub fn notify(&self, notice: Notice) -> u64

NEST-16: say notice to whoever listens; answers how many do.

Source

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.

Source

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.

Source

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).

Source

pub fn list_methods(&self) -> Vec<String>

List all methods across all activations

Source

pub fn list_activations_info(&self) -> Vec<ActivationInfo>

List all activations (including this hub itself)

Source

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).

Source

pub async fn route( &self, method: &str, params: Value, auth: Option<&AuthContext>, ) -> Result<PlexusStream, PlexusError>

Route a call to the appropriate activation

Source

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).

Source

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.

Source

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.

Source

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.

Source

pub fn get_activation_schema(&self, namespace: &str) -> Option<Schema>

Get activation schema

Source

pub fn registry_snapshot(&self) -> PluginRegistrySnapshot

Get a snapshot of the activation registry (safe to use outside locks)

Source

pub fn lookup_plugin(&self, id: Uuid) -> Option<String>

Look up an activation path by its UUID

Source

pub fn lookup_plugin_by_path(&self, path: &str) -> Option<Uuid>

Look up an activation UUID by its path

Source

pub fn list_plugin_schemas(&self) -> Vec<PluginSchema>

Get activation schemas for all activations (including this hub itself)

Source

pub fn list_full_schemas(&self) -> Vec<PluginSchema>

👎Deprecated:

Use list_plugin_schemas instead

Deprecated: use list_plugin_schemas instead

Source

pub fn get_method_help(&self, method: &str) -> Option<String>

Get help for a method

Source

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.

Source

pub fn into_rpc_module(self) -> Result<RpcModule<()>, RegisterMethodError>

Convert to RPC module

Source

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.

Source

pub fn arc_into_rpc_module( hub: Arc<Self>, ) -> Result<RpcModule<()>, RegisterMethodError>

Convert Arc to RPC module while keeping the Arc alive

Unlike into_rpc_module, this keeps the Arc reference alive, which is necessary when activations hold Weak references that need to remain upgradeable.

Source§

impl DynamicHub

Source

pub const NAMESPACE: &'static str = "plexus"

Source

pub const PLUGIN_ID: Uuid

Stable plugin instance ID for handle routing

Source

pub fn plugin_id(&self) -> Uuid

Get the plugin’s stable instance ID

Trait Implementations§

Source§

impl Activation for DynamicHub

Source§

type Methods = DynamicHubMethod

Source§

fn namespace(&self) -> &str

Source§

fn version(&self) -> &str

Source§

fn description(&self) -> &str

Short description (max 15 words)
Source§

fn long_description(&self) -> Option<&str>

Long description (optional, for detailed documentation)
Source§

fn methods(&self) -> Vec<&str>

Source§

fn method_help(&self, method: &str) -> Option<String>

Source§

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,

Source§

fn into_rpc_methods(self) -> Methods

Source§

fn plugin_schema(&self) -> PluginSchema

Return this activation’s schema (methods + optional children)
Source§

fn slot_schema() -> Option<PluginSchema>
where Self: Sized,

NEST-5: this activation’s schema without an instance — what a parent’s dynamic #[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

Stable activation instance ID for handle routing By default generates a deterministic UUID from namespace+major_version Using major version only ensures handles survive minor/patch upgrades (semver)
Source§

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)>

MACRO-20: this activation’s static children and theirs, as (path, schema) — the same list as ChildRouter::router_static_child_schemas, reachable from the hub’s type-erased registry (which holds Activations). Read more
Source§

fn needs(&self) -> Option<Vec<Need>>

NEST-16: what this activation calls of the service it is grafted onto — its schema’s needs, answered without building the schema (#[plexus_macros::activation(parent = …)] emits it). None: it declares nothing.
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

Source§

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

Get the namespace of this router (for error messages)
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,

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 Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a child activation instance by name for nested routing
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,

NEST-7: the child or peer named 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

Which optional operations (list / search) this router supports. Read more
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,

Stream every child name the router is willing to enumerate. Read more
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,

Stream child names matching the router-defined query semantics. Read more
Source§

fn router_schema(&self) -> Option<PluginSchema>

MACRO-20: this router’s own schema, when it has one. Read more
Source§

fn router_static_child_schemas(&self) -> Vec<(String, PluginSchema)>

MACRO-20: every static child below this router that describes itself, as (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 more
Source§

fn framework_stamped_principal(&self) -> Principal

Framework-stamped immediate-caller plexus_auth_core::Principal of this router. Read more
Source§

impl Clone for DynamicHub

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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,

Route a call to a registered activation
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,

Get plexus configuration hash (from the recursive schema) Read more
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,

Get plugin hashes for cache validation
Source§

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSendSync for T
where T: Send + Sync,

Source§

impl<T> Peer for T

Source§

fn interface(&self) -> Interface

The shape this peer serves.
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,

Call one of its methods (repos, or a path below it: child.m).
Source§

fn peer<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Peer>, PeerError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

The primitive, one level down: this peer’s own peers by name.
Source§

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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