[−][src]Struct warmy::load::Discovery
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]
F: 'static + FnMut(&Path, &mut Storage<C, K>, &mut C),
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
Auto Trait Implementations
impl<C, K> Unpin for Discovery<C, K>
impl<C, K> !Sync for Discovery<C, K>
impl<C, K> !Send for Discovery<C, K>
impl<C, K> !UnwindSafe for Discovery<C, K>
impl<C, K> !RefUnwindSafe for Discovery<C, K>
Blanket Implementations
impl<'a, T, C, M> Inspect<'a, C, (), M> for T
[src]
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
[src]
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,