Seregon/StratoSDK

StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.

Rust/27.3 KB/No license
crates/strato-ui-core/src/assets/mod.rs
1use anyhow::{anyhow, Result};
2use std::borrow::Cow;
3pub mod asset_cache;
4 
5impl 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 
14pub trait AssetProvider: 'static {
15 fn get(&self, path: &str) -> Result<Cow<'_, [u8]>>;
16}
17