Struct comfy_core::Assets

source ·
pub struct Assets {
Show 15 fields pub texture_send: Arc<Mutex<Sender<Vec<LoadRequest>>>>, pub texture_recv: Arc<Mutex<Receiver<Vec<LoadRequest>>>>, pub textures: HashMap<String, TextureHandle>, pub texture_load_queue: Vec<(String, String)>, pub texture_image_map: Arc<Mutex<HashMap<TextureHandle, DynamicImage>>>, pub sound_load_queue: Vec<(String, String)>, pub sound_ids: HashMap<String, Sound>, pub sounds: Arc<Mutex<HashMap<Sound, StaticSoundData>>>, pub sound_handles: HashMap<Sound, StaticSoundHandle>, pub sound_groups: HashMap<String, Vec<Sound>>, pub sound_send: Arc<Mutex<Sender<LoadSoundRequest>>>, pub sound_recv: Arc<Mutex<Receiver<LoadSoundRequest>>>, pub thread_pool: ThreadPool, pub current_queue: Arc<Mutex<Option<TextureLoadQueue>>>, pub asset_source: Option<AssetSource>,
}

Fields§

§texture_send: Arc<Mutex<Sender<Vec<LoadRequest>>>>§texture_recv: Arc<Mutex<Receiver<Vec<LoadRequest>>>>§textures: HashMap<String, TextureHandle>§texture_load_queue: Vec<(String, String)>§texture_image_map: Arc<Mutex<HashMap<TextureHandle, DynamicImage>>>§sound_load_queue: Vec<(String, String)>§sound_ids: HashMap<String, Sound>§sounds: Arc<Mutex<HashMap<Sound, StaticSoundData>>>§sound_handles: HashMap<Sound, StaticSoundHandle>§sound_groups: HashMap<String, Vec<Sound>>§sound_send: Arc<Mutex<Sender<LoadSoundRequest>>>§sound_recv: Arc<Mutex<Receiver<LoadSoundRequest>>>§thread_pool: ThreadPool§current_queue: Arc<Mutex<Option<TextureLoadQueue>>>§asset_source: Option<AssetSource>

Implementations§

source§

impl Assets

source

pub fn new() -> Self

source

pub fn load_sound_from_bytes( &mut self, name: &str, bytes: &[u8], settings: StaticSoundSettings )

source

pub fn process_load_queue(&mut self)

source

pub fn process_sound_queue(&mut self)

source

pub fn handle_name(handle: TextureHandle) -> Option<String>

source

pub fn insert_handle(&mut self, name: &str, handle: TextureHandle)

source

pub fn get_texture(&self, key: &str) -> TextureHandle

source

pub fn image_size(handle: TextureHandle) -> Option<UVec2>

source

pub fn load_image_data( path: &str, texture: TextureHandle ) -> Option<DynamicImage>

source

pub fn error_loading_image(path: &str)

Auto Trait Implementations§

§

impl !RefUnwindSafe for Assets

§

impl Send for Assets

§

impl Sync for Assets

§

impl Unpin for Assets

§

impl !UnwindSafe for Assets

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for Fwhere T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> Any for Twhere T: Any,

source§

impl<T> Component for Twhere T: Send + Sync + 'static,

§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,