| Crates.io | runar_node |
| lib.rs | runar_node |
| version | 0.1.0 |
| created_at | 2025-08-14 12:27:14.768673+00 |
| updated_at | 2025-08-14 12:27:14.768673+00 |
| description | Runar Node implementation |
| homepage | https://github.com/runar-labs/runar-rust |
| repository | https://github.com/runar-labs/runar-rust |
| max_upload_size | |
| id | 1794800 |
| size | 641,531 |
The core runtime for the Runar framework. A Node manages service lifecycles, routes requests, publishes/consumes events, and coordinates networking.
use runar_node::{Node, NodeConfig};
# async fn run() -> anyhow::Result<()> {
let config = NodeConfig::new("my-node", "default-network");
let mut node = Node::new(config).await?;
// Add your services here (see runar-macros for easy definitions)
// node.add_service(MyService::new()).await?;
node.start().await?;
node.wait_for_services_to_start().await?;
// Make a local request (service must register an action at this path)
// let resp = node.request::<()> ("my-service/ping", None).await?;
node.stop().await?;
Ok(())
# }
Use runar_macros to declare services and actions succinctly. See that crate’s
README for a full example. Conceptually:
use anyhow::Result;
use runar_macros::{service, action};
#[service(name = "EchoService", path = "echo-service", description = "Echo", version = "1.0.0")]
struct EchoService;
#[service]
impl EchoService {
#[action]
async fn ping(&self) -> Result<String> { Ok("pong".to_string()) }
}
runar-keys (X.509, P-256)runar-serializerStructured logging via runar_common::logging with component prefixes and
context (action/event paths). Use the provided macros in runar_macros_common.
Rust 1.70.0
MIT. See LICENSE.