pub trait SlottedProvider {
    // Required method
    fn provide<'a>(&'a self, slot: usize, demand: &mut Demand<'a>);

    // Provided method
    fn provide_mut<'a>(&'a mut self, _slot: usize, _demand: &mut Demand<'a>) { ... }
}
Expand description

Like Provider, but with a “slot” to hint on what’s being requested. Normally with Provider, the provider needs to provide everything it can provide, leading to O(n) time complexity. This trait instead provide a “slot” to hint on what’s being requested, allowing providers to provide only what’s needed, thus speed things up.

Required Methods§

source

fn provide<'a>(&'a self, slot: usize, demand: &mut Demand<'a>)

Provided Methods§

source

fn provide_mut<'a>(&'a mut self, _slot: usize, _demand: &mut Demand<'a>)

Implementors§