| Crates.io | runar_gateway |
| lib.rs | runar_gateway |
| version | 0.1.0 |
| created_at | 2025-08-14 13:05:08.78746+00 |
| updated_at | 2025-08-14 13:05:08.78746+00 |
| description | Runar Gateway |
| homepage | https://github.com/runar-labs/runar-rust |
| repository | https://github.com/runar-labs/runar-rust |
| max_upload_size | |
| id | 1794849 |
| size | 125,805 |
HTTP gateway for Runar nodes using axum. Exposes registered service actions
as REST endpoints and forwards requests to the local node.
[dependencies]
runar_gateway = "0.1"
/{service-path}/{action} to the corresponding service actionArcValuetower-httpuse anyhow::Result;
use runar_macros::{service, action};
use runar_serializer::{ArcValue, Plain};
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, PartialEq, Plain)]
struct MyTestData { id: i32, name: String, active: bool }
#[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()) }
#[action]
async fn echo(&self, message: String) -> Result<String> { Ok(message) }
#[action]
async fn echo_struct(&self, data: MyTestData) -> Result<MyTestData> { Ok(data) }
}
/echo-service/ping → "pong"/echo-service/echo with { "message": "hello" } → "hello"/echo-service/echo_struct with MyTestData → echo back structRust 1.70.0
MIT. See LICENSE.