Crates.io | fastedge |
lib.rs | fastedge |
version | 0.1.10 |
source | src |
created_at | 2024-05-08 12:55:22.397471 |
updated_at | 2024-10-22 10:43:14.000047 |
description | FastEdge Rust SDK that helps you to create edge cloud application using WASM |
homepage | |
repository | https://github.com/G-Core/FastEdge-sdk-rust.git |
max_upload_size | |
id | 1233757 |
size | 59,765 |
This is the Rust SDK for building applications ready for deploying on FastEdge runtime. FastEdge Runtime SDK is a simple SDK that helps you to create edge cloud application using WebAssembly component model and Wasmtime runtime.
Please read through the documentation provided by Gcore.
The table below summarizes the feature support for language SDKs.
Feature | Rust | JavaScript |
---|---|---|
Handlers | ||
HTTP | Supported | Supported |
APIs | ||
Outbound HTTP | Supported | Supported |
Env Variables | Supported | Supported |
rustup target add wasm32-wasip1
Example of simple app with http entrypoint:
// lib.rs
use anyhow::Result;
use fastedge::http::{Request, Response, StatusCode};
use fastedge::body::Body;
#[fastedge::http]
fn main(req: Request<Body>) -> Result<Response<Body>> {
Response::builder().status(StatusCode::OK).body(Body::empty())
}
The important things to note in the function above:
fastedge::http
macro — this marks the function as the
entrypoint for the FastEdge applicationfn main(req: Request<Body>) -> Result<Response<Body>>
—
uses the HTTP objects from the popular Rust crate
http