Skip to main content

Module factory

Module factory 

Source
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§

NativeAnnouncementRequest
Complete, already-validated native announcement ready for publication.
NativeServiceAnnouncement
Complete native announcement material verified against one accepted state.
QuicSharedConfig
Shared QUIC/WebTransport configuration for all services.
ServiceContext
Context for service creation.
ServiceFactory
Service factory for inventory-based registration.

Enums§

NativeAnnouncementReach
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§

NativeAnnouncementPublisher
NativeIrohAnnouncementCallback
Owned callback joining carrier binding to the signed announcement lifecycle.
ServiceFactoryFn
Factory function signature for creating services.