Added assetserver and macro

This commit is contained in:
2025-11-01 21:40:55 -07:00
parent 47f6296896
commit e84e77dff9
4 changed files with 278 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
[package]
name = "assetserver"
version = { workspace = true }
rust-version = { workspace = true }
edition = { workspace = true }
[lints]
workspace = true

View File

@@ -0,0 +1,16 @@
/// A static asset with compile-time embedded data.
pub trait Asset {
/// The common URL prefix for all assets (e.g., "/assets")
const URL_PREFIX: &'static str;
/// The specific URL path for this asset (e.g., "/logo.png")
const URL_POSTFIX: &'static str;
/// The full URL for this asset (e.g., "/assets/logo.png")
const URL: &'static str;
/// The embedded file contents as a byte slice
const BYTES: &'static [u8];
}
// TODO: image manipulation