Struct actix_web::dev::Resource
[−]
[src]
pub struct Resource { /* fields omitted */ }
Resource type describes an entry in resources table
Methods
impl Resource
[src]
pub fn new(name: &str, path: &str) -> Self
[src]
Parse path pattern and create new Resource
instance.
Panics if path pattern is wrong.
pub fn prefix(name: &str, path: &str) -> Self
[src]
Parse path pattern and create new Resource
instance.
Use prefix
type instead of static
.
Panics if path regex pattern is wrong.
pub fn external(name: &str, path: &str) -> Self
[src]
Construct external resource
Panics if path pattern is wrong.
pub fn with_prefix(
name: &str,
path: &str,
prefix: &str,
for_prefix: bool
) -> Self
[src]
name: &str,
path: &str,
prefix: &str,
for_prefix: bool
) -> Self
Parse path pattern and create new Resource
instance with custom prefix
pub fn name(&self) -> &str
[src]
Name of the resource
pub fn rtype(&self) -> ResourceType
[src]
Resource type
pub fn pattern(&self) -> &str
[src]
Path pattern of the resource
pub fn is_match(&self, path: &str) -> bool
[src]
pub fn match_with_params<'a>(
&'a self,
path: &'a str,
params: &'a mut Params<'a>
) -> bool
[src]
&'a self,
path: &'a str,
params: &'a mut Params<'a>
) -> bool
pub fn match_prefix_with_params<'a>(
&'a self,
path: &'a str,
params: &'a mut Params<'a>
) -> Option<usize>
[src]
&'a self,
path: &'a str,
params: &'a mut Params<'a>
) -> Option<usize>
pub fn resource_path<U, I>(
&self,
router: &Router,
elements: U
) -> Result<String, UrlGenerationError> where
U: IntoIterator<Item = I>,
I: AsRef<str>,
[src]
&self,
router: &Router,
elements: U
) -> Result<String, UrlGenerationError> where
U: IntoIterator<Item = I>,
I: AsRef<str>,
Build resource path.
Trait Implementations
impl Clone for Resource
[src]
fn clone(&self) -> Resource
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Resource
[src]
fn eq(&self, other: &Resource) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.