Struct warmy::load::Discovery

source ·
pub struct Discovery<C, K> { /* private fields */ }
Expand description

Discovery.

Such an object is called whenever a new resource is discovered and is relied on to decide what to do with the resource.

If you don’t care about discovering new resources, feel free to use the Default implementation.

Implementations§

Create an new filter.

The closure is passed the path of the discovered resource along with the storage and the context so that you can get that resource if you want. Keep in mind that the path is a raw and absolute path: you’ll have to extract the key (according to the type of resource you target) and pattern-match the extension / mime type on your own to choose which type of resource you want to get. Or you’ll just go full one-way and use the same resource type for all discovery, that’s also possible.

Trait Implementations§

The default filter.

  • Ignores any discovery.
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Inspect the context.
Inspect the context.
Inspect the context.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.