Skip to main content

declares_expectation_in

Function declares_expectation_in 

Source
pub fn declares_expectation_in<F: Family, T: Controller + DeclaresExpectation>(
    c: T,
) -> T
Expand description

declares_expectation, plus the value check: the controller’s DeclaresExpectation::EXPECTS must be one of F::ACCEPTS. The check is a const assertion evaluated when this instantiation is compiled — i.e. when the generated init() is reachable from something that runs, which in an application it always is. A failure reads as an E0080 naming the controller type in its “while instantiating” note. (The boot-time coverage check over Router::mounts() remains the backstop that needs no reachability.)