Struct ajars_actix_web::actix_web::dev::ResourceDef [−]
pub struct ResourceDef { /* fields omitted */ }
Expand description
ResourceDef describes an entry in resources table
Resource definition can contain only 16 dynamic segments
Implementations
impl ResourceDef
impl ResourceDef
pub fn new<T>(path: T) -> ResourceDef where
T: IntoPattern,
pub fn new<T>(path: T) -> ResourceDef where
T: IntoPattern,
Parse path pattern and create new Pattern
instance.
Panics if path pattern is malformed.
pub fn prefix(path: &str) -> ResourceDef
pub fn prefix(path: &str) -> ResourceDef
Parse path pattern and create new Pattern
instance.
Use prefix
type instead of static
.
Panics if path regex pattern is malformed.
pub fn root_prefix(path: &str) -> ResourceDef
pub fn root_prefix(path: &str) -> ResourceDef
Parse path pattern and create new Pattern
instance.
Inserts /
to begging of the pattern.
Use prefix
type instead of static
.
Panics if path regex pattern is malformed.
pub fn is_prefix_match(&self, path: &str) -> Option<usize>
pub fn is_prefix_match(&self, path: &str) -> Option<usize>
Is prefix path a match against this resource.
pub fn match_path<T>(&self, path: &mut Path<T>) -> bool where
T: ResourcePath,
pub fn match_path<T>(&self, path: &mut Path<T>) -> bool where
T: ResourcePath,
Is the given path and parameters a match against this pattern.
pub fn match_path_checked<R, T, F, U>(
&self,
res: &mut R,
check: &F,
user_data: &Option<U>
) -> bool where
T: ResourcePath,
R: Resource<T>,
F: Fn(&R, &Option<U>) -> bool,
pub fn match_path_checked<R, T, F, U>(
&self,
res: &mut R,
check: &F,
user_data: &Option<U>
) -> bool where
T: ResourcePath,
R: Resource<T>,
F: Fn(&R, &Option<U>) -> bool,
Is the given path and parameters a match against this pattern?
Build resource path from elements. Returns true
on success.
Trait Implementations
impl Clone for ResourceDef
impl Clone for ResourceDef
pub fn clone(&self) -> ResourceDef
pub fn clone(&self) -> ResourceDef
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl Debug for ResourceDef
impl Debug for ResourceDef
impl<'a> From<&'a str> for ResourceDef
impl<'a> From<&'a str> for ResourceDef
pub fn from(path: &'a str) -> ResourceDef
pub fn from(path: &'a str) -> ResourceDef
Performs the conversion.
impl From<String> for ResourceDef
impl From<String> for ResourceDef
pub fn from(path: String) -> ResourceDef
pub fn from(path: String) -> ResourceDef
Performs the conversion.
impl Hash for ResourceDef
impl Hash for ResourceDef
impl PartialEq<ResourceDef> for ResourceDef
impl PartialEq<ResourceDef> for ResourceDef
impl Eq for ResourceDef
Auto Trait Implementations
impl RefUnwindSafe for ResourceDef
impl Send for ResourceDef
impl Sync for ResourceDef
impl Unpin for ResourceDef
impl UnwindSafe for ResourceDef
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self