| Crates.io | hyveos-sdk |
| lib.rs | hyveos-sdk |
| version | 0.1.0 |
| created_at | 2025-01-14 03:18:36.163976+00 |
| updated_at | 2025-01-14 03:18:36.163976+00 |
| description | SDK for the hyveOS system |
| homepage | https://docs.p2p.industries |
| repository | https://github.com/p2p-industries/hyveos/tree/main/sdks/rust |
| max_upload_size | |
| id | 1515393 |
| size | 190,033 |
A Rust SDK for the hyveOS system
Make sure you've installed hyveOS. Select a version of the SDK compatible with your local hyveOS version
[dependencies]
hyveos-sdk = "0.1.0"
See the service docs for an extensive description of the available services or the tutorials page for a hands-on quickstart.
use hyveos_sdk::Connection;
use futures::TryStreamExt as _;
#[tokio::main]
async fn main() {
let connection = Connection::new().await.unwrap();
let mut req_resp_service = connection.req_resp();
let mut requests = req_resp_service.recv(None).await.unwrap();
while let Some((request, handle)) = requests.try_next().await.unwrap() {
let string = String::from_utf8(request.data).unwrap();
println!("Received request from {}: {string}", request.peer_id);
handle.respond("Hello from the other side!").await.unwrap();
}
}