pub struct AssetLoader {
pub thread_pool: ThreadPool,
pub wgpu_load_queue: Arc<Mutex<Option<TextureLoadQueue>>>,
pub texture_load_queue: Vec<(String, String)>,
pub sound_load_queue: Vec<(String, String)>,
pub sounds: Arc<Mutex<HashMap<Sound, StaticSoundData>>>,
pub sound_send: Arc<Mutex<Sender<SoundAssetData>>>,
pub sound_recv: Arc<Mutex<Receiver<SoundAssetData>>>,
pub texture_data_send: Arc<Mutex<Sender<TextureAssetData>>>,
pub texture_data_recv: Arc<Mutex<Receiver<TextureAssetData>>>,
pub asset_source: Option<AssetSource>,
pub data_load_queue: Vec<AssetData>,
pub pending_textures: HashSet<String>,
}
Fields§
§thread_pool: ThreadPool
§wgpu_load_queue: Arc<Mutex<Option<TextureLoadQueue>>>
§texture_load_queue: Vec<(String, String)>
§sound_load_queue: Vec<(String, String)>
§sounds: Arc<Mutex<HashMap<Sound, StaticSoundData>>>
§sound_send: Arc<Mutex<Sender<SoundAssetData>>>
§sound_recv: Arc<Mutex<Receiver<SoundAssetData>>>
§texture_data_send: Arc<Mutex<Sender<TextureAssetData>>>
§texture_data_recv: Arc<Mutex<Receiver<TextureAssetData>>>
§asset_source: Option<AssetSource>
§data_load_queue: Vec<AssetData>
§pending_textures: HashSet<String>
Implementations§
Source§impl AssetLoader
impl AssetLoader
pub fn new(sounds: Arc<Mutex<HashMap<Sound, StaticSoundData>>>) -> Self
pub fn queue_load_sounds(&mut self, sounds: Vec<(String, String)>)
pub fn queue_load_textures(&mut self, textures: Vec<(String, String)>)
pub fn parse_texture_byte_queue( &mut self, texture_image_map: Arc<Mutex<HashMap<TextureHandle, Arc<RgbaImage>>>>, )
pub fn sound_tick(&mut self)
pub fn load_textures_to_memory( &mut self, loaded_textures: HashSet<TextureHandle>, textures: &mut HashMap<String, TextureHandle>, )
pub fn load_sounds_to_memory(&mut self, sound_ids: &mut HashMap<String, Sound>)
Auto Trait Implementations§
impl Freeze for AssetLoader
impl !RefUnwindSafe for AssetLoader
impl Send for AssetLoader
impl Sync for AssetLoader
impl Unpin for AssetLoader
impl !UnwindSafe for AssetLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more