mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 22:49:21 +02:00
expose app's ResourceMap via resource_map method
This commit is contained in:
@ -174,6 +174,12 @@ impl HttpRequest {
|
||||
self.url_for(name, &NO_PARAMS)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Get a reference to a `ResourceMap` of current application.
|
||||
pub fn resource_map(&self) -> &ResourceMap {
|
||||
&self.0.rmap
|
||||
}
|
||||
|
||||
/// Peer socket address
|
||||
///
|
||||
/// Peer address is actual socket address, if proxy is used in front of
|
||||
|
@ -18,6 +18,7 @@ use crate::dev::insert_slash;
|
||||
use crate::guard::Guard;
|
||||
use crate::info::ConnectionInfo;
|
||||
use crate::request::HttpRequest;
|
||||
use crate::rmap::ResourceMap;
|
||||
|
||||
pub trait HttpServiceFactory {
|
||||
fn register(self, config: &mut AppService);
|
||||
@ -169,10 +170,17 @@ impl ServiceRequest {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Get a mutable reference to the Path parameters.
|
||||
pub fn match_info_mut(&mut self) -> &mut Path<Url> {
|
||||
self.0.match_info_mut()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Get a reference to a `ResourceMap` of current application.
|
||||
pub fn resource_map(&self) -> &ResourceMap {
|
||||
self.0.resource_map()
|
||||
}
|
||||
|
||||
/// Service configuration
|
||||
#[inline]
|
||||
pub fn app_config(&self) -> &AppConfig {
|
||||
|
Reference in New Issue
Block a user