diff --git a/src/application.rs b/src/application.rs index 268b10afe..68aa4a579 100644 --- a/src/application.rs +++ b/src/application.rs @@ -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