Struct actix_web::dev::ResourceDef [−][src]
pub struct ResourceDef { /* fields omitted */ }
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
fn clone(&self) -> ResourceDef
[src]
fn clone(&self) -> ResourceDef
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for ResourceDef
[src]
impl Debug for ResourceDef
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for ResourceDef
[src]
impl PartialEq for ResourceDef
fn eq(&self, other: &ResourceDef) -> bool
[src]
fn eq(&self, other: &ResourceDef) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
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