Trait fyrox_resource::loader::ResourceLoader
source · pub trait ResourceLoader: ResourceLoaderTypeTrait {
// Required methods
fn extensions(&self) -> &[&str];
fn data_type_uuid(&self) -> Uuid;
fn load(&self, path: PathBuf, io: Arc<dyn ResourceIo>) -> BoxedLoaderFuture;
// Provided methods
fn supports_extension(&self, ext: &str) -> bool { ... }
fn try_load_import_settings(
&self,
resource_path: PathBuf,
io: Arc<dyn ResourceIo>
) -> BoxedImportOptionsLoaderFuture { ... }
fn default_import_options(&self) -> Option<Box<dyn BaseImportOptions>> { ... }
}
Expand description
Trait for resource loading.
Required Methods§
sourcefn extensions(&self) -> &[&str]
fn extensions(&self) -> &[&str]
Returns a list of file extensions supported by the loader. Resource manager will use this list to pick the correct resource loader when the user requests a resource.
sourcefn data_type_uuid(&self) -> Uuid
fn data_type_uuid(&self) -> Uuid
Must return a type uuid of the resource data type.
sourcefn load(&self, path: PathBuf, io: Arc<dyn ResourceIo>) -> BoxedLoaderFuture
fn load(&self, path: PathBuf, io: Arc<dyn ResourceIo>) -> BoxedLoaderFuture
Loads or reloads a resource.
Provided Methods§
sourcefn supports_extension(&self, ext: &str) -> bool
fn supports_extension(&self, ext: &str) -> bool
Checks if the given extension is supported by this loader. Comparison is case-insensitive.
sourcefn try_load_import_settings(
&self,
resource_path: PathBuf,
io: Arc<dyn ResourceIo>
) -> BoxedImportOptionsLoaderFuture
fn try_load_import_settings( &self, resource_path: PathBuf, io: Arc<dyn ResourceIo> ) -> BoxedImportOptionsLoaderFuture
Tries to load import settings for a resource.
sourcefn default_import_options(&self) -> Option<Box<dyn BaseImportOptions>>
fn default_import_options(&self) -> Option<Box<dyn BaseImportOptions>>
Returns default import options for the resource.