Struct actix_web::dev::ResourceDef [−][src]
pub struct ResourceDef { /* fields omitted */ }Resource type describes an entry in resources table
Methods
impl ResourceDef[src]
impl ResourceDefpub fn new(path: &str) -> Self[src]
pub fn new(path: &str) -> SelfParse 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) -> SelfParse 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) -> SelfConstruct 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) -> SelfParse path pattern and create new Resource instance with custom prefix
pub fn rtype(&self) -> ResourceType[src]
pub fn rtype(&self) -> ResourceTypeResource type
pub fn name(&self) -> &str[src]
pub fn name(&self) -> &strResource name
pub fn pattern(&self) -> &str[src]
pub fn pattern(&self) -> &strPath pattern of the resource
pub fn is_match(&self, path: &str) -> bool[src]
pub fn is_match(&self, path: &str) -> boolIs 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 ResourceDeffn clone(&self) -> ResourceDef[src]
fn clone(&self) -> ResourceDefReturns 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 ResourceDeffn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for ResourceDef[src]
impl PartialEq for ResourceDeffn eq(&self, other: &ResourceDef) -> bool[src]
fn eq(&self, other: &ResourceDef) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Eq for ResourceDef[src]
impl Eq for ResourceDefimpl Hash for ResourceDef[src]
impl Hash for ResourceDefAuto Trait Implementations
impl !Send for ResourceDef
impl !Send for ResourceDefimpl !Sync for ResourceDef
impl !Sync for ResourceDef