allow to access application state during configuration stage

This commit is contained in:
Nikolay Kim 2018-04-26 09:05:07 -07:00
parent c5b9bed478
commit fd876efa68
1 changed files with 6 additions and 0 deletions

View File

@ -200,6 +200,12 @@ where
}
}
/// Get reference to the application state
pub fn state(&self) -> &S {
let parts = self.parts.as_ref().expect("Use after finish");
&parts.state
}
/// Set application prefix.
///
/// Only requests that match the application's prefix get