20 lines
746 B
Rust
20 lines
746 B
Rust
use crate::asset::{AssetEntry, BankStats, BankType, HandleId, LoadStatus, PreloadEntry, SlotRef, SlotStats};
|
|
|
|
pub trait AssetBridge {
|
|
fn initialize_for_cartridge(
|
|
&self,
|
|
assets: Vec<AssetEntry>,
|
|
preload: Vec<PreloadEntry>,
|
|
assets_data: Vec<u8>,
|
|
);
|
|
fn load(&self, asset_name: &str, slot: SlotRef) -> Result<HandleId, String>;
|
|
fn status(&self, handle: HandleId) -> LoadStatus;
|
|
fn commit(&self, handle: HandleId);
|
|
fn cancel(&self, handle: HandleId);
|
|
fn apply_commits(&self);
|
|
fn bank_info(&self, kind: BankType) -> BankStats;
|
|
fn slot_info(&self, slot: SlotRef) -> SlotStats;
|
|
fn find_slot_by_name(&self, asset_name: &str, kind: BankType) -> Option<u8>;
|
|
fn shutdown(&self);
|
|
}
|