Struct actix_web::dev::ResourceDef [−][src]
Resource type describes an entry in resources table
Methods
impl ResourceDef
[src]
[−]
impl ResourceDef
pub fn new(path: &str) -> Self
[src]
[−]
pub fn new(path: &str) -> Self
Parse path pattern and create new Resource
instance.
Panics if path pattern is wrong.
pub fn prefix(path: &str) -> Self
[src]
[−]
pub fn prefix(path: &str) -> Self
Parse path pattern and create new Resource
instance.
Use prefix
type instead of static
.
Panics if path regex pattern is wrong.
pub fn external(path: &str) -> Self
[src]
[−]
pub fn external(path: &str) -> Self
Construct external resource
Panics if path pattern is wrong.
pub fn with_prefix(path: &str, prefix: &str, for_prefix: bool) -> Self
[src]
[−]
pub fn with_prefix(path: &str, prefix: &str, for_prefix: bool) -> Self
Parse path pattern and create new Resource
instance with custom prefix
pub fn rtype(&self) -> ResourceType
[src]
[−]
pub fn rtype(&self) -> ResourceType
Resource type
pub fn name(&self) -> &str
[src]
[−]
pub fn name(&self) -> &str
Resource name
pub fn pattern(&self) -> &str
[src]
[−]
pub fn pattern(&self) -> &str
Path pattern of the resource
pub fn is_match(&self, path: &str) -> bool
[src]
[−]
pub fn is_match(&self, path: &str) -> bool
Is this path a match against this resource?
pub fn match_with_params(&self, req: &Request, plen: usize) -> Option<Params>
[src]
[−]
pub fn match_with_params(&self, req: &Request, plen: usize) -> Option<Params>
Are the given path and parameters a match against this resource?
pub fn match_prefix_with_params(
&self,
req: &Request,
plen: usize
) -> Option<Params>
[src]
[−]
pub fn match_prefix_with_params(
&self,
req: &Request,
plen: usize
) -> Option<Params>
Is the given path a prefix match and do the parameters match against this resource?
pub fn resource_path<U, I>(
&self,
elements: U,
prefix: &str
) -> Result<String, UrlGenerationError> where
U: IntoIterator<Item = I>,
I: AsRef<str>,
[src]
[−]
pub fn resource_path<U, I>(
&self,
elements: U,
prefix: &str
) -> Result<String, UrlGenerationError> where
U: IntoIterator<Item = I>,
I: AsRef<str>,
Build resource path.
Trait Implementations
impl Clone for ResourceDef
[src]
[+]
impl Clone for ResourceDef
impl Debug for ResourceDef
[src]
[+]
impl Debug for ResourceDef
impl PartialEq for ResourceDef
[src]
[+]
impl PartialEq for ResourceDef
impl Eq for ResourceDef
[src]
impl Eq for ResourceDef
impl Hash for ResourceDef
[src]
[+]
impl Hash for ResourceDef
Auto Trait Implementations
impl !Send for ResourceDef
impl !Send for ResourceDef
impl !Sync for ResourceDef
impl !Sync for ResourceDef