pub fn new<F, B>(mut definer: F) -> Result<Self, GenError>
    where
        F: FnMut(E) -> Result<B, InGenError>,
        B: Into<Block>,
    {
        let mut map = HashMap::new();
        for key in E::iter() {
            let block: Block = definer(key.clone())
                .map_err(|e| GenError::failure(e, name_in_module(&key)))?
                .into();
            map.insert(key, block);
        }
        Ok(Self { map })
    }
/// Constructs a `BlockProvider` with block definitions computed by the given function.
Constructs a `BlockProvider` with block definitions computed by the given function.
Constructs a ` BlockProvider ` with block definitions computed by the given function .
pub fn new<F, B>(mut definer: F) -> Result<Self, GenError>
    where
        F: FnMut(E) -> Result<B, InGenError>,
        B: Into<Block>,
    {
        let mut map = HashMap::new();
        for key in E::iter() {
            let block: Block = definer(key.clone())
                .map_err(|e| GenError::failure(e, name_in_module(&key)))?
                .into();
            map.insert(key, block);
        }
        Ok(Self { map })
    }
pub fn new < F , B > ( mut definer : F ) -> Result < Self , GenError > where F : FnMut ( E ) -> Result < B , InGenError > , B : Into < Block > , { let mut map = HashMap :: new ( ) ; for key in E :: iter ( ) { let block : Block = definer ( key . clone ( ) ) . map_err ( | e | GenError :: failure ( e , name_in_module ( & key ) ) ) ? . into ( ) ; map . insert ( key , block ) ; } Ok ( Self { map } ) }
Constructs a `BlockProvider` with block definitions computed by the given function.
Constructs a ` BlockProvider ` with block definitions computed by the given function .
definer
F