mirror of https://github.com/rwf2/Rocket.git
Rename 'state' to 'managed' in 'Request' for clarity.
This commit is contained in:
parent
94534c3895
commit
81bae5246b
|
@ -20,7 +20,7 @@ use http::hyper;
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct RequestState<'r> {
|
struct RequestState<'r> {
|
||||||
config: &'r Config,
|
config: &'r Config,
|
||||||
state: &'r Container,
|
managed: &'r Container,
|
||||||
params: RefCell<Vec<(usize, usize)>>,
|
params: RefCell<Vec<(usize, usize)>>,
|
||||||
route: Cell<Option<&'r Route>>,
|
route: Cell<Option<&'r Route>>,
|
||||||
cookies: RefCell<CookieJar>,
|
cookies: RefCell<CookieJar>,
|
||||||
|
@ -59,7 +59,7 @@ impl<'r> Request<'r> {
|
||||||
remote: None,
|
remote: None,
|
||||||
state: RequestState {
|
state: RequestState {
|
||||||
config: &rocket.config,
|
config: &rocket.config,
|
||||||
state: &rocket.state,
|
managed: &rocket.state,
|
||||||
route: Cell::new(None),
|
route: Cell::new(None),
|
||||||
params: RefCell::new(Vec::new()),
|
params: RefCell::new(Vec::new()),
|
||||||
cookies: RefCell::new(CookieJar::new()),
|
cookies: RefCell::new(CookieJar::new()),
|
||||||
|
@ -559,7 +559,7 @@ impl<'r> Request<'r> {
|
||||||
/// Get the managed state T, if it exists. For internal use only!
|
/// Get the managed state T, if it exists. For internal use only!
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub(crate) fn get_state<T: Send + Sync + 'static>(&self) -> Option<&'r T> {
|
pub(crate) fn get_state<T: Send + Sync + 'static>(&self) -> Option<&'r T> {
|
||||||
self.state.state.try_get()
|
self.state.managed.try_get()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert from Hyper types into a Rocket Request.
|
/// Convert from Hyper types into a Rocket Request.
|
||||||
|
|
Loading…
Reference in New Issue