Skip to main content

Crate mecha10_core

Crate mecha10_core 

Source
Expand description

Mecha10 Core Runtime

This crate provides the foundational runtime for the Mecha10 framework, including node lifecycle management, health monitoring, and orchestration.

§Features

  • Node lifecycle management (start, stop, restart)
  • Health monitoring and automatic recovery
  • Process management for node execution
  • Integration with config and messaging systems
  • Graceful shutdown handling
  • Type-safe topics system
  • Comprehensive error handling
  • Shared message types

§Quick Start

use mecha10_core::prelude::*;
use mecha10_core::topics::{perception, sensor};

#[derive(Debug)]
struct MyNode {
    config: MyConfig,
}

#[derive(Debug, Deserialize)]
struct MyConfig {
    threshold: f32,
}

#[async_trait]
impl NodeImpl for MyNode {
    type Config = MyConfig;

    async fn init(config: Self::Config) -> Result<Self> {
        Ok(Self { config })
    }

    async fn run(&mut self, ctx: &Context) -> Result<()> {
        let mut images = ctx.subscribe(sensor::CAMERA_RGB).await?;

        while let Some(image) = images.recv().await {
            // Process image into detections, then publish the result.
            let result = Vec::new();
            ctx.publish_to(perception::DETECTIONS, &result).await?;
        }

        Ok(())
    }
}

Re-exports§

pub use context::Context;
pub use context::Receiver;
pub use error::Mecha10Error;
pub use error::Result;
pub use messages::Message;
pub use inventory;
pub use types::*;

Modules§

actuator
Shared actuator message types
aggregated
Aggregated Topics - Multi-topic subscription with pattern matching
auth
Authorization and Access Control
circuit_breaker
Circuit Breaker Pattern for Fault Tolerance
config
config_watcher
Configuration Hot-Reload Support
context
Node execution context
dependency
Dependency Resolution for Node Startup/Shutdown Ordering
discovery
Service Discovery
error
fs_utils
Filesystem utility helpers shared across binaries (CLI, launcher-service, …).
geometry
Shared 2D axis-aligned bounding-box geometry and greedy Non-Maximum Suppression (NMS).
kinematics
Shared kinematics helpers for wheeled-robot odometry.
macros
Mecha10 Framework Macros
messages
metrics
Metrics Collection
model
Model configuration utilities for AI nodes
node
node_config_base
The shared base config contract every node’s resolved config composes with.
node_registry
Link-time self-registration foundation for discovering framework node schema/catalog metadata, without hand-enumerating every built-in node type in Rust match arms.
ollama
Detects whether a project needs a local Ollama server running.
prelude
priority_queue
Priority queue for message processing
profiling
Performance Profiling Helpers
rate_limit
Rate Limiting
recovery
Graceful Degradation and Automatic Recovery Policies
relay_topics
Relay topics auto-derivation for websocket-bridge.
rwlock_collections
Async extension trait for collecting the keys/values of a tokio::sync::RwLock<HashMap<K, V>>.
schema
Schema Registry
secrets
Secrets Management
sensor
Shared sensor message types
service
Service Pattern for Infrastructure Components
state
Persistent State Storage Abstraction for Nodes
teleop
Teleoperation message types
topic_registry
Topic Registry for Runtime Introspection and Validation
topic_utils
Topic utility functions
topics
Type-Safe Topics System
types
Core type definitions shared across the Mecha10 framework
wire_identifier
Parsing for a node’s “wire identifier” - the single string form a node’s instance_id/ camera_id get encoded into wherever a typed NodeRef isn’t available to carry them as separate fields (e.g. mecha10-node-runner‘s CLI args, mecha10-templates’ generated robot binary, which can’t depend on mecha10-cli-core where NodeRef itself lives).

Macros§

builder_build
builder_setter
camera_image_decode_fn
debug_struct_fields
default_struct_fields
differential_drive_odometry_impl
enum_display_via_str
enum_str_method
impl_bounding_box
in_node_context
log_shutdown_fn_body
model_preflight
new_then_run_fn
new_with_defaults
node_binary_main
node_main
odometry_publish_fn
register_node
Register a crate::node::NodeImpl type’s NodeDescriptor for discovery by a later wave’s consumer.
topic_group
zeroed_count_init_body

Structs§

Runtime

Enums§

RuntimeError

Type Aliases§

RuntimeResult