pub trait ImageCacheImpl {
Show 14 methods
// Required methods
fn get_texture(&self, id: usize) -> &Option<Texture>;
fn set_texture(&mut self, texture: Option<Texture>, id: usize);
// Provided methods
fn lazy_create_image_cache(&mut self, cx: &mut Cx) { ... }
fn load_png_from_data(
&mut self,
cx: &mut Cx,
data: &[u8],
id: usize,
) -> Result<(), ImageError> { ... }
fn load_jpg_from_data(
&mut self,
cx: &mut Cx,
data: &[u8],
id: usize,
) -> Result<(), ImageError> { ... }
fn image_size_by_data(
data: &[u8],
image_path: &Path,
) -> Result<(usize, usize), ImageError> { ... }
fn image_size_by_path(
image_path: &Path,
) -> Result<(usize, usize), ImageError> { ... }
fn process_async_image_load(
&mut self,
cx: &mut Cx,
image_path: &Path,
result: Result<ImageBuffer, ImageError>,
) -> bool { ... }
fn load_image_from_cache(
&mut self,
cx: &mut Cx,
image_path: &Path,
id: usize,
) -> bool { ... }
fn load_image_from_data_async_impl(
&mut self,
cx: &mut Cx,
image_path: &Path,
data: Arc<Vec<u8>>,
id: usize,
) -> Result<AsyncLoadResult, ImageError> { ... }
fn load_image_file_by_path_async_impl(
&mut self,
cx: &mut Cx,
image_path: &Path,
id: usize,
) -> Result<AsyncLoadResult, ImageError> { ... }
fn load_image_file_by_path_and_data(
&mut self,
cx: &mut Cx,
data: &[u8],
id: usize,
image_path: &Path,
) -> Result<(), ImageError> { ... }
fn load_image_file_by_path(
&mut self,
cx: &mut Cx,
image_path: &Path,
id: usize,
) -> Result<(), ImageError> { ... }
fn load_image_dep_by_path(
&mut self,
cx: &mut Cx,
image_path: &str,
id: usize,
) -> Result<(), ImageError> { ... }
}
Required Methods§
fn get_texture(&self, id: usize) -> &Option<Texture>
fn set_texture(&mut self, texture: Option<Texture>, id: usize)
Provided Methods§
fn lazy_create_image_cache(&mut self, cx: &mut Cx)
fn load_png_from_data( &mut self, cx: &mut Cx, data: &[u8], id: usize, ) -> Result<(), ImageError>
fn load_jpg_from_data( &mut self, cx: &mut Cx, data: &[u8], id: usize, ) -> Result<(), ImageError>
fn image_size_by_data( data: &[u8], image_path: &Path, ) -> Result<(usize, usize), ImageError>
fn image_size_by_path(image_path: &Path) -> Result<(usize, usize), ImageError>
fn process_async_image_load( &mut self, cx: &mut Cx, image_path: &Path, result: Result<ImageBuffer, ImageError>, ) -> bool
fn load_image_from_cache( &mut self, cx: &mut Cx, image_path: &Path, id: usize, ) -> bool
fn load_image_from_data_async_impl( &mut self, cx: &mut Cx, image_path: &Path, data: Arc<Vec<u8>>, id: usize, ) -> Result<AsyncLoadResult, ImageError>
fn load_image_file_by_path_async_impl( &mut self, cx: &mut Cx, image_path: &Path, id: usize, ) -> Result<AsyncLoadResult, ImageError>
fn load_image_file_by_path_and_data( &mut self, cx: &mut Cx, data: &[u8], id: usize, image_path: &Path, ) -> Result<(), ImageError>
fn load_image_file_by_path( &mut self, cx: &mut Cx, image_path: &Path, id: usize, ) -> Result<(), ImageError>
fn load_image_dep_by_path( &mut self, cx: &mut Cx, image_path: &str, id: usize, ) -> Result<(), ImageError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.