#[non_exhaustive]pub struct UrlMap {
pub url_regex: String,
pub security_level: SecurityLevel,
pub login: LoginRequirement,
pub auth_fail_action: AuthFailAction,
pub redirect_http_response_code: RedirectHttpResponseCode,
pub handler_type: Option<HandlerType>,
/* private fields */
}
Expand description
URL pattern and description of how the URL should be handled. App Engine can handle URLs by executing application code or by serving static files uploaded with the version, such as images, CSS, or JavaScript.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.url_regex: String
URL prefix. Uses regular expression syntax, which means regexp special characters must be escaped, but should not contain groupings. All URLs that begin with this prefix are handled by this handler, using the portion of the URL after the prefix as part of the file path.
security_level: SecurityLevel
Security (HTTPS) enforcement for this URL.
login: LoginRequirement
Level of login required to access this resource. Not supported for Node.js in the App Engine standard environment.
auth_fail_action: AuthFailAction
Action to take when users access resources that require
authentication. Defaults to redirect
.
redirect_http_response_code: RedirectHttpResponseCode
30x
code to use when performing redirects for the secure
field.
Defaults to 302
.
handler_type: Option<HandlerType>
Type of handler for this URL pattern.
Implementations§
Source§impl UrlMap
impl UrlMap
pub fn new() -> Self
Sourcepub fn set_url_regex<T: Into<String>>(self, v: T) -> Self
pub fn set_url_regex<T: Into<String>>(self, v: T) -> Self
Sets the value of url_regex.
Sourcepub fn set_security_level<T: Into<SecurityLevel>>(self, v: T) -> Self
pub fn set_security_level<T: Into<SecurityLevel>>(self, v: T) -> Self
Sets the value of security_level.
Sourcepub fn set_login<T: Into<LoginRequirement>>(self, v: T) -> Self
pub fn set_login<T: Into<LoginRequirement>>(self, v: T) -> Self
Sets the value of login.
Sourcepub fn set_auth_fail_action<T: Into<AuthFailAction>>(self, v: T) -> Self
pub fn set_auth_fail_action<T: Into<AuthFailAction>>(self, v: T) -> Self
Sets the value of auth_fail_action.
Sourcepub fn set_redirect_http_response_code<T: Into<RedirectHttpResponseCode>>(
self,
v: T,
) -> Self
pub fn set_redirect_http_response_code<T: Into<RedirectHttpResponseCode>>( self, v: T, ) -> Self
Sets the value of redirect_http_response_code.
Sourcepub fn set_handler_type<T: Into<Option<HandlerType>>>(self, v: T) -> Self
pub fn set_handler_type<T: Into<Option<HandlerType>>>(self, v: T) -> Self
Sets the value of handler_type.
Note that all the setters affecting handler_type
are mutually
exclusive.
Sourcepub fn static_files(&self) -> Option<&Box<StaticFilesHandler>>
pub fn static_files(&self) -> Option<&Box<StaticFilesHandler>>
The value of handler_type
if it holds a StaticFiles
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_static_files<T: Into<Box<StaticFilesHandler>>>(self, v: T) -> Self
pub fn set_static_files<T: Into<Box<StaticFilesHandler>>>(self, v: T) -> Self
Sets the value of handler_type
to hold a StaticFiles
.
Note that all the setters affecting handler_type
are
mutually exclusive.
Sourcepub fn script(&self) -> Option<&Box<ScriptHandler>>
pub fn script(&self) -> Option<&Box<ScriptHandler>>
The value of handler_type
if it holds a Script
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_script<T: Into<Box<ScriptHandler>>>(self, v: T) -> Self
pub fn set_script<T: Into<Box<ScriptHandler>>>(self, v: T) -> Self
Sets the value of handler_type
to hold a Script
.
Note that all the setters affecting handler_type
are
mutually exclusive.
Sourcepub fn api_endpoint(&self) -> Option<&Box<ApiEndpointHandler>>
pub fn api_endpoint(&self) -> Option<&Box<ApiEndpointHandler>>
The value of handler_type
if it holds a ApiEndpoint
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_api_endpoint<T: Into<Box<ApiEndpointHandler>>>(self, v: T) -> Self
pub fn set_api_endpoint<T: Into<Box<ApiEndpointHandler>>>(self, v: T) -> Self
Sets the value of handler_type
to hold a ApiEndpoint
.
Note that all the setters affecting handler_type
are
mutually exclusive.