30 lines
1.3 KiB
Rust
30 lines
1.3 KiB
Rust
use crate::asset::{
|
|
AssetBacklogInfo, AssetBacklogPosition, AssetEntry, AssetId, AssetLoadError, AssetOpStatus,
|
|
AssetTargetStatus, BankTelemetry, BankType, HandleId, LoadStatus, PreloadEntry, SlotRef,
|
|
SlotStats,
|
|
};
|
|
use crate::cartridge::AssetsPayloadSource;
|
|
|
|
pub trait AssetBridge {
|
|
fn initialize_for_cartridge(
|
|
&self,
|
|
assets: Vec<AssetEntry>,
|
|
preload: Vec<PreloadEntry>,
|
|
assets_data: AssetsPayloadSource,
|
|
);
|
|
fn load(&self, asset_id: AssetId, slot_index: usize) -> Result<HandleId, AssetLoadError>;
|
|
fn status(&self, handle: HandleId) -> LoadStatus;
|
|
fn commit(&self, handle: HandleId) -> AssetOpStatus;
|
|
fn cancel(&self, handle: HandleId) -> AssetOpStatus;
|
|
fn backlog_info(&self) -> AssetBacklogInfo;
|
|
fn backlog_position(&self, handle: HandleId) -> AssetBacklogPosition;
|
|
fn backlog_move(&self, handle: HandleId, new_position: usize) -> AssetOpStatus;
|
|
fn backlog_promote(&self, handle: HandleId) -> AssetOpStatus;
|
|
fn backlog_demote(&self, handle: HandleId) -> AssetOpStatus;
|
|
fn target_status(&self, bank_type: BankType, slot: usize) -> AssetTargetStatus;
|
|
fn apply_commits(&self);
|
|
fn bank_telemetry(&self) -> Vec<BankTelemetry>;
|
|
fn slot_info(&self, slot: SlotRef) -> SlotStats;
|
|
fn shutdown(&self);
|
|
}
|