StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.
| 1 | use anyhow::{anyhow, Result}; |
| 2 | use std::borrow::Cow; |
| 3 | pub mod asset_cache; |
| 4 | |
| 5 | impl AssetProvider for () { |
| 6 | fn get(&self, path: &str) -> Result<Cow<'_, [u8]>> { |
| 7 | Err(anyhow!( |
| 8 | "get called on empty asset provider with \"{}\"", |
| 9 | path |
| 10 | )) |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | pub trait AssetProvider: 'static { |
| 15 | fn get(&self, path: &str) -> Result<Cow<'_, [u8]>>; |
| 16 | } |
| 17 |