mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-28 01:52:57 +01:00
allow to access application state during configuration stage
This commit is contained in:
parent
c5b9bed478
commit
fd876efa68
@ -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.
|
/// Set application prefix.
|
||||||
///
|
///
|
||||||
/// Only requests that match the application's prefix get
|
/// Only requests that match the application's prefix get
|
||||||
|
Loading…
Reference in New Issue
Block a user