pub struct Hyper { /* private fields */ }Expand description
Hyper — pre-workload framework infrastructure.
Hyper is the operating system that runs an Actor: it owns configuration,
instance identity, trust material, and the package verifier. It is
deliberately generic-free and has no knowledge of a specific workload.
User code constructs Hyper only in the escape-hatch path
(Node::from_hyper); prefer Node::from_config_file for the common
case where config lives in actr.toml. The full typestate chain is:
Node::from_config_file(path) -> Node<Init> (framework only)
Node::from_hyper(hyper, config) -> Node<Init> (escape hatch)
.attach(package) -> Node<Attached> (attach: wasm / dyn lib)
.link(workload) -> Node<Attached> (link: static lib)
.register(ais_endpoint) -> Node<Registered> (credential obtained)
.start() -> ActrRef (running node)Once you call attach, you no longer have a Hyper: you have a Node,
which is “Hyper wired to a workload”. register and start live on
Node, not on Hyper.
Implementations§
Source§impl Hyper
impl Hyper
Sourcepub async fn new(config: HyperConfig) -> Result<Self, HyperError>
pub async fn new(config: HyperConfig) -> Result<Self, HyperError>
Construct a Hyper with native defaults (uses tokio::fs / ActorStore).
- Parse configuration
- Load or generate instance_id (persisted to data_dir)
- Initialize package verifier
Sourcepub async fn with_platform(
config: HyperConfig,
platform: Arc<dyn PlatformProvider>,
) -> Result<Self, HyperError>
pub async fn with_platform( config: HyperConfig, platform: Arc<dyn PlatformProvider>, ) -> Result<Self, HyperError>
Construct a Hyper with an injected platform provider (cross-platform / embedded).
When a PlatformProvider is injected:
- instance UID comes from
platform.instance_uid()(and its backing store) bootstrap_credentialusesplatform.secret_store()instead ofActorStore::open()TrustProviderverifies.actrpackage signatures using whatever mechanism the injected provider implements
Sourcepub async fn verify_package(
&self,
package: &WorkloadPackage,
) -> Result<VerifiedPackage, HyperError>
pub async fn verify_package( &self, package: &WorkloadPackage, ) -> Result<VerifiedPackage, HyperError>
Verify a WorkloadPackage and return the verified package bundle
(parsed manifest + raw manifest bytes + signature).
Delegates entirely to the configured crate::verify::TrustProvider;
the provider decides how to authenticate the package (static key,
registry lookup, keyless transparency log, etc).
Source§impl Hyper
impl Hyper
Sourcepub fn resolve_storage_path(
&self,
manifest: &PackageManifest,
) -> Result<PathBuf, HyperError>
pub fn resolve_storage_path( &self, manifest: &PackageManifest, ) -> Result<PathBuf, HyperError>
Resolve the storage namespace path for a verified manifest.
The path is fixed here; all subsequent storage operations are isolated based on this path.
Sourcepub async fn bootstrap_credential(
&self,
verified: &VerifiedPackage,
ais_endpoint: &str,
realm_id: u32,
service_spec: Option<ServiceSpec>,
acl: Option<Acl>,
) -> Result<RegisterOk, HyperError>
pub async fn bootstrap_credential( &self, verified: &VerifiedPackage, ais_endpoint: &str, realm_id: u32, service_spec: Option<ServiceSpec>, acl: Option<Acl>, ) -> Result<RegisterOk, HyperError>
Bootstrap credential registration with AIS (two-phase flow).
Hyper completes registration bootstrap on behalf of the Actor and returns the full AIS registration payload.
§Two-Phase Logic
- Phase 1 (first registration): no valid PSK in ActorStore -> register with MFR-signed manifest -> AIS returns credential + PSK -> stored in ActorStore
- Phase 2 (PSK renewal): valid PSK exists in ActorStore -> register directly with PSK -> AIS returns new credential
§Parameters
verified: verified package bundle (fromverify_package) — carries the parsed manifest plus the raw manifest bytes and signature needed for phase-1 registration with AIS.ais_endpoint: AIS HTTP address, e.g."http://ais.example.com:8080"realm_id: target Realm IDservice_spec: optional protobuf API metadata published to discoveryacl: optional access-control policy attached to the actor
Sourcepub fn instance_id(&self) -> &str
pub fn instance_id(&self) -> &str
Current instance_id
Sourcepub fn config(&self) -> &HyperConfig
pub fn config(&self) -> &HyperConfig
Current configuration
Auto Trait Implementations§
impl !RefUnwindSafe for Hyper
impl !UnwindSafe for Hyper
impl Freeze for Hyper
impl Send for Hyper
impl Sync for Hyper
impl Unpin for Hyper
impl UnsafeUnpin for Hyper
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more