Skip to main content

ShaderLoader

Struct ShaderLoader 

Source
pub struct ShaderLoader;
Expand description

Default implementation for shader loading.

Trait Implementations§

Source§

impl ResourceLoader for ShaderLoader

Source§

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.
Source§

fn data_type_uuid(&self) -> Uuid

Must return a type uuid of the resource data type.
Source§

fn load(&self, path: PathBuf, io: Arc<dyn ResourceIo>) -> BoxedLoaderFuture

Loads or reloads a resource.
Source§

fn is_native_extension(&self, ext: &str) -> bool

Returns true if the given extension corresponds to a resource in the native file format. The default implementation returns false, which assumes that the extension corresponds to a foreign file format.
Source§

fn supports_extension(&self, ext: &str) -> bool

Checks if the given extension is supported by this loader. Comparison is case-insensitive.
Source§

fn convert( &self, src_path: PathBuf, dest_path: PathBuf, platform: TargetPlatform, io: Arc<dyn ResourceIo>, ) -> Pin<Box<dyn Future<Output = Result<(), FileError>>>>

Loads a resource from the given path and converts it to a format, that is the most efficient fot the given platform. This method is usually used to convert resources for production builds; to make the resources as efficient as possible for the given platform. This method saves the converted resource to the given dest_path. If the resource is already in its final form, then this method should just copy the file from src_path to dest_path.
Source§

fn try_load_import_settings( &self, resource_path: PathBuf, io: Arc<dyn ResourceIo>, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn BaseImportOptions>>>>>

Tries to load import settings for a resource.
Source§

fn default_import_options(&self) -> Option<Box<dyn BaseImportOptions>>

Returns default import options for the resource.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsyncTaskResult for T
where T: Any + Send + 'static,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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.

Source§

impl<T, U> Into<U> for T
where 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.

Source§

impl<T, U> ObjectOrVariant<T> for U

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V