pub trait AssetBundle: Debug {
// Required method
fn load(
&self,
key: &str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, String>>>>;
}Expand description
Bytes for a named asset. Flutter AssetBundle.
Answering takes time — a bundle may be reading a file or the network — so it answers with a future, as Dart’s does. Flutter’s also carries string and structured helpers, its own caching and a network fallback; those are deferred.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".