#wasm-edge #sdk #applications #cloud #run-time #create #helps

fastedge

FastEdge Rust SDK that helps you to create edge cloud application using WASM

5 releases

new 0.1.10 Oct 22, 2024
0.1.8 Oct 21, 2024
0.1.7 Aug 20, 2024
0.1.6 May 10, 2024
0.1.5 May 8, 2024

#215 in WebAssembly

Download history 150/week @ 2024-08-18 6/week @ 2024-08-25 1/week @ 2024-09-01 14/week @ 2024-09-15 7/week @ 2024-09-22 6/week @ 2024-09-29 1/week @ 2024-10-06 295/week @ 2024-10-20

302 downloads per month

Apache-2.0

19KB
281 lines

FastEdge Rust SDK

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.

Getting Started

Please read through the documentation provided by Gcore.

Language Support

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

Rust toolchain setup:

  • rustup target add wasm32-wasip1

The FastEdge Rust SDK

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:

  • the fastedge::http macro — this marks the function as the entrypoint for the FastEdge application
  • the function signature — fn main(req: Request<Body>) -> Result<Response<Body>> — uses the HTTP objects from the popular Rust crate http

Dependencies

~1.3–2.1MB
~40K SLoC