referrerpolicy=no-referrer-when-downgrade

with_parameter

Function with_parameter 

Source
pub fn with_parameter<T: Clone, R>(
    get: fn() -> T,
    set: fn(T),
    value: T,
    test: impl FnOnce() -> R,
) -> R
Expand description

Runs test with a parameter_types! static set to value, and restores the previous value when test ends, whether it returns or panics.

get and set are the accessors parameter_types! generates for the static, for example GasScale::get and GasScale::set.