[][src]Struct warmy::load::Discovery

pub struct Discovery<C, K> { /* fields omitted */ }

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.

Methods

impl<C, K> Discovery<C, K>[src]

pub fn new<F>(f: F) -> Self where
    F: 'static + FnMut(&Path, &mut Storage<C, K>, &mut C), 
[src]

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

impl<C, K> Default for Discovery<C, K>[src]

The default filter.

  • Ignores any discovery.

Auto Trait Implementations

impl<C, K> !Send for Discovery<C, K>

impl<C, K> !Sync for Discovery<C, K>

Blanket Implementations

impl<'a, T, C, M> Inspect for T[src]

impl<'a, T, C, M> Inspect for T[src]

impl<'a, T, C, M> Inspect for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.