kagura_asset_loader

    Async image/asset streaming and priority-queued loading for Kagura, on top of mizchi/atlas + mizchi/gfx (extracted from kagura_engine)

    Download zip
    Author
    Version
    0.6.0
    License
    Apache-2.0
    Last updated
    15 days ago
    Downloads
    9

    mizchi/kagura_asset_loader does not have a README file

    AssetEntry

    type AssetEntry

    AssetPriority

    pub enum AssetPriority {
    Critical
    High
    Normal
    Low
    } derive(Eq,
    Debug
    )

    AssetPriority::equal

    AssetPriority::not_equal

    fn AssetPriority::not_equal(x : AssetPriority, y : AssetPriority) -> Bool

    AssetPriority::output

    fn AssetPriority::output(self : AssetPriority, logger : &Logger) -> Unit

    AssetPriority::to_string

    fn AssetPriority::to_string(self : AssetPriority) -> String

    AssetStreamManager

    pub struct AssetStreamManager {
    fetcher : &
    BytesFetcher

    max_concurrent : Int
    next_id : Int
    pending : Array[StreamRequest]
    active : Map[Int, StreamRequest]
    completed_count : Int
    failed_count : Int
    }

    AssetStreamManager::cancel

    fn AssetStreamManager::cancel(self : AssetStreamManager, id : Int) -> Unit

    AssetStreamManager::enqueue

    fn AssetStreamManager::enqueue(self : AssetStreamManager, url : String, priority : AssetPriority, on_complete : (Bytes?) -> Unit) -> Int

    AssetStreamManager::image_fetch_fn

    fn AssetStreamManager::image_fetch_fn(self : AssetStreamManager, priority? : AssetPriority) -> ((String, (
    ImageSpec
    ?) -> Unit) -> Unit)

    Creates an AsyncImageLoader-compatible fetch_image_fn from this stream manager.

    AssetStreamManager::new

    AssetStreamManager::progress

    AssetStreamManager::reprioritize

    fn AssetStreamManager::reprioritize(self : AssetStreamManager, id : Int, new_priority : AssetPriority) -> Bool

    AssetStreamManager::update

    fn AssetStreamManager::update(self : AssetStreamManager) -> Unit

    AssetStreamer

    pub struct AssetStreamer {
    manager : AssetStreamManager
    config : AssetStreamerConfig
    frame_count : Int
    handles : Map[String, AssetEntry]
    on_evict : (
    AssetKey
    ) -> Unit
    }

    AssetStreamer::evict

    AssetStreamer::progress

    AssetStreamer::request

    fn AssetStreamer::request(self : AssetStreamer, url : String, key :
    AssetKey
    , priority : AssetPriority, on_complete : (Bytes?) -> Unit) -> Int

    AssetStreamer::request_by_distance

    fn AssetStreamer::request_by_distance(self : AssetStreamer, url : String, key :
    AssetKey
    , distance : Double, thresholds? : DistanceThresholds, on_complete~ : (Bytes?) -> Unit) -> Int

    AssetStreamer::request_lod

    fn AssetStreamer::request_lod(self : AssetStreamer, url : String, key :
    AssetKey
    , lod_level : Int, priority : AssetPriority, on_complete : (Bytes?) -> Unit) -> Int

    AssetStreamer::stream_manager

    fn AssetStreamer::stream_manager(self : AssetStreamer) -> AssetStreamManager

    AssetStreamer::touch

    AssetStreamer::update

    fn AssetStreamer::update(self : AssetStreamer) -> Unit

    AssetStreamerConfig

    pub(all) struct AssetStreamerConfig {
    max_concurrent : Int
    max_cached : Int
    eviction_interval : Int
    } derive(
    Debug
    )

    AssetStreamerConfig::default

    AssetStreamerConfig::output

    fn AssetStreamerConfig::output(self : AssetStreamerConfig, logger : &Logger) -> Unit

    AssetStreamerConfig::to_string

    fn AssetStreamerConfig::to_string(self : AssetStreamerConfig) -> String

    AsyncImageLoader

    pub struct AsyncImageLoader {
    next_id : Int
    requests : Map[Int, AsyncImageRequest]
    pending_ids : Array[Int]
    completed_ids : Array[Int]
    fetch_image_fn : (String, (
    ImageSpec
    ?) -> Unit) -> Unit
    }

    AsyncImageLoader::drain_completed

    fn AsyncImageLoader::drain_completed(self : AsyncImageLoader) -> Array[Int]

    AsyncImageLoader::enqueue

    fn AsyncImageLoader::enqueue(self : AsyncImageLoader, key :
    AssetKey
    , url : String) -> Int

    AsyncImageLoader::new

    fn AsyncImageLoader::new(fetch_image_fn? : (String, (
    ImageSpec
    ?) -> Unit) -> Unit) -> AsyncImageLoader

    AsyncImageLoader::progress

    AsyncImageLoader::request

    fn AsyncImageLoader::request(self : AsyncImageLoader, id : Int) -> AsyncImageRequest?

    AsyncImageLoader::start_pending

    fn AsyncImageLoader::start_pending(self : AsyncImageLoader) -> Int

    AsyncImageProgress

    pub struct AsyncImageProgress {
    total : Int
    pending : Int
    loading : Int
    succeeded : Int
    failed : Int
    } derive(
    Debug
    )

    AsyncImageProgress::output

    fn AsyncImageProgress::output(self : AsyncImageProgress, logger : &Logger) -> Unit

    AsyncImageProgress::to_string

    fn AsyncImageProgress::to_string(self : AsyncImageProgress) -> String

    AsyncImageRequest

    pub struct AsyncImageRequest {
    id : Int
    key :
    AssetKey

    url : String
    status : AsyncImageStatus
    image_spec :
    ImageSpec
    ?
    } derive(
    Debug
    )

    AsyncImageRequest::output

    fn AsyncImageRequest::output(self : AsyncImageRequest, logger : &Logger) -> Unit

    AsyncImageRequest::to_string

    fn AsyncImageRequest::to_string(self : AsyncImageRequest) -> String

    AsyncImageStatus

    pub enum AsyncImageStatus {
    Pending
    Loading
    Succeeded
    Failed
    } derive(
    Debug
    )

    AsyncImageStatus::output

    fn AsyncImageStatus::output(self : AsyncImageStatus, logger : &Logger) -> Unit

    AsyncImageStatus::to_int

    fn AsyncImageStatus::to_int(self : AsyncImageStatus) -> Int

    AsyncImageStatus::to_string

    fn AsyncImageStatus::to_string(self : AsyncImageStatus) -> String

    DistanceThresholds

    pub(all) struct DistanceThresholds {
    critical : Double
    high : Double
    normal : Double
    } derive(
    Debug
    )

    DistanceThresholds::default

    DistanceThresholds::output

    fn DistanceThresholds::output(self : DistanceThresholds, logger : &Logger) -> Unit

    DistanceThresholds::to_string

    fn DistanceThresholds::to_string(self : DistanceThresholds) -> String

    StreamProgress

    pub(all) struct StreamProgress {
    total : Int
    pending : Int
    active : Int
    completed : Int
    failed : Int
    } derive(
    Debug
    )

    StreamProgress::output

    fn StreamProgress::output(self : StreamProgress, logger : &Logger) -> Unit

    StreamProgress::to_string

    fn StreamProgress::to_string(self : StreamProgress) -> String

    StreamRequest

    type StreamRequest

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io