Skip to main content

Myrmic SDK

The Myrmic SDK is the Rust library for writing cells.

Each page covers one topic: what it is for, the operations it offers, an example, and how it behaves. Use it when you know what you want to do and need the exact operations, behavior, or limits.

Cell model

Messaging

  • Commands - Receive and send directed, named messages between cells.
  • Callbacks - Name a handler to receive the answer to a command.
  • Events - Publish named messages and receive them through event handlers.
  • Message encoding - Encode typed payloads, raw bytes, empty messages, and custom wire formats.

Scheduling and time

Cell lifecycle

State and storage

  • Storage scopes - Scope every operation on the runtime database, private to one cell or public and shared.
  • Transient state - Hold a value in the cell's WebAssembly memory for as long as the cell runs.
  • Persistent cell state - Store, load, mutate, and upsert one typed value that lives in the persistent runtime database.
  • Key-value store - Store many typed values beneath a shared prefix, and read them by prefix.
  • Table store - Keep a named collection of values of one type, each under a key, and read them in key order.
  • Time-series store - Append timestamped measurements and query samples by series, range, limit, and order.
  • Semantic store - Run SPARQL update and select queries over RDF triples.
  • Blob store - Store, read, list, rename, and delete binary content held under file-like paths.

External systems

  • Gateway routes - Expose a swarm to HTTP clients under a URL path, over plain HTTP or a WebSocket.
  • Gateway assets - Serve static files from a cell's blob storage on a gateway route.
  • Bridges - Connect a cell to an MQTT broker or an HTTP service outside the swarm.

Signal Layer (I/O)

  • Signal taps - Read a Signal Layer input by name, either its latest value or its queued events.
  • Signal outlets - Drive a device through a named Signal Layer output, writing a typed value or raw bytes.

Bluetooth Low Energy

Hardware

  • GPIO - Acquire numbered pins, perform digital I/O, and wait for levels or edges.

Diagnostics

  • Logging - Log a message at one of five levels.
  • Errors - See how a handler fails, what an error carries, and what the runtime rolls back.
Cookie Policy