Skip to main content

MapleRuntime

Struct MapleRuntime 

Source
pub struct MapleRuntime { /* private fields */ }
Expand description

The MAPLE Resonance Runtime - heart of the entire MAPLE ecosystem

This runtime powers:

  • Mapleverse: Coordination of millions of pure AI agents
  • Finalverse: Meaningful human-AI coexistence in experiential worlds
  • iBank: Accountable autonomous financial operations

Implementations§

Source§

impl MapleRuntime

Source

pub async fn bootstrap(config: RuntimeConfig) -> Result<Self, BootstrapError>

Bootstrap the MAPLE Resonance Runtime

This initializes all subsystems in the correct order to ensure architectural invariants are satisfied from the start.

§Arguments
  • config - Runtime configuration
§Returns
  • Ok(MapleRuntime) - Successfully bootstrapped runtime
  • Err(BootstrapError) - Bootstrap failed
§Example
use maple_runtime::{MapleRuntime, config::RuntimeConfig};

#[tokio::main]
async fn main() {
    let config = RuntimeConfig::default();
    let runtime = MapleRuntime::bootstrap(config).await.unwrap();
}
Source

pub async fn shutdown(&self) -> Result<(), ShutdownError>

Shutdown gracefully, preserving all commitments

This ensures that:

  1. No new commitments are accepted
  2. Active commitments are completed or recorded
  3. All Resonator continuity is persisted
  4. Coupling topology is saved
Source

pub async fn is_shutting_down(&self) -> bool

Check if runtime is shutting down

Source

pub async fn register_resonator( &self, spec: ResonatorSpec, ) -> Result<ResonatorHandle, RegistrationError>

Register a new Resonator

This creates a persistent identity that survives restarts, migrations, and network partitions.

§Arguments
  • spec - Resonator specification
§Returns
  • Ok(ResonatorHandle) - Handle to the registered Resonator
  • Err(RegistrationError) - Registration failed
Source

pub async fn resume_resonator( &self, continuity_proof: ContinuityProof, ) -> Result<ResonatorHandle, ResumeError>

Resume a Resonator from continuity record

This restores a Resonator’s identity, memory, and pending commitments after a restart or migration.

Source

pub fn presence_fabric(&self) -> &Arc<PresenceFabric>

Source

pub fn coupling_fabric(&self) -> &Arc<CouplingFabric>

Source

pub fn attention_allocator(&self) -> &Arc<AttentionAllocator>

Source

pub fn temporal_coordinator(&self) -> &Arc<TemporalCoordinator>

Source

pub fn scheduler(&self) -> &Arc<ResonanceScheduler>

Source

pub fn telemetry(&self) -> &Arc<RuntimeTelemetry>

Trait Implementations§

Source§

impl Clone for MapleRuntime

Source§

fn clone(&self) -> MapleRuntime

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more

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<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> 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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