1 个不稳定版本
0.1.0 | 2022年6月19日 |
---|
#1292 在 HTTP服务器
每月104 次下载
16KB
313 行
actix-embed
使用actix提供嵌入式文件。
use actix_web::App;
use actix_embed::Embed;
use rust_embed::RustEmbed;
#[derive(RustEmbed)]
#[folder = "testdata/"]
struct Assets;
let app = App::new()
.service(Embed::new("/static", &Assets));
lib.rs
:
actix-embed
使用actix提供嵌入式文件。
use actix_web::App;
use actix_embed::Embed;
use rust_embed::RustEmbed;
#[derive(RustEmbed)]
#[folder = "testdata/"]
struct Assets;
let app = App::new()
.service(Embed::new("/static", &Assets));
依赖项
~16–26MB
~461K SLoC