Expand description
Service factory infrastructure for inventory-based service registration.
This module provides the ServiceFactory type and ServiceContext for
implementing the same inventory pattern used for ScopeDefinition and
DriverFactory.
§Example
ⓘ
use hyprstream_service::service::factory::{ServiceContext, ServiceFactory};
use hyprstream_rpc_derive::service_factory;
#[service_factory("policy")]
fn create_policy_service(ctx: &ServiceContext) -> anyhow::Result<Box<dyn Spawnable>> {
// Services include infrastructure and are directly Spawnable
let policy = PolicyService::new(
...,
ctx.transport("policy", SocketKind::Rep),
ctx.verifying_key(),
);
Ok(Box::new(policy))
}Structs§
- Native
Announcement Request - Complete, already-validated native announcement ready for publication.
- Native
Service Announcement - Complete native announcement material verified against one accepted state.
- Quic
Shared Config - Shared QUIC/WebTransport configuration for all services.
- Service
Context - Context for service creation.
- Service
Factory - Service factory for inventory-based registration.
Enums§
- Native
Announcement Reach - Dynamic carrier reach for an otherwise authority-bound announcement.
Functions§
- deployment_
data_ dir - Deployment-owned registry directory shared by the checkpoint writer and authenticated process bootstrap. No caller-provided context or path can influence this value.
- get_
factory - Get a service factory by name.
- list_
factories - List all registered service factories.
Type Aliases§
- Native
Announcement Publisher - Native
Iroh Announcement Callback - Owned callback joining carrier binding to the signed announcement lifecycle.
- Service
Factory Fn - Factory function signature for creating services.