[−][src]Struct actix_web::dev::ResourceDef
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 ResourceDef
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 ResourceDef
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 def
Panics if path pattern is wrong.
pub fn with_prefix(path: &str, for_prefix: bool, slash: bool) -> Self
[src]
pub fn with_prefix(path: &str, for_prefix: bool, slash: bool) -> Self
Parse path pattern and create new ResourceDef
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,
path: &mut String,
elements: &mut U
) -> Result<(), UrlGenerationError> where
U: Iterator<Item = I>,
I: AsRef<str>,
[src]
pub fn resource_path<U, I>(
&self,
path: &mut String,
elements: &mut U
) -> Result<(), UrlGenerationError> where
U: Iterator<Item = I>,
I: AsRef<str>,
Build resource path.
Trait Implementations
impl PartialEq<ResourceDef> for ResourceDef
[src]
impl PartialEq<ResourceDef> 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
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Eq for ResourceDef
[src]
impl Eq for ResourceDef
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 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
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> Erased for T
impl<T> Erased for T
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.