Struct actix_web::dev::Params
[−]
[src]
pub struct Params<'a>(_);
Route match information
If resource path contains variable patterns, Params
stores this variables.
Methods
impl<'a> Params<'a>
[src]
pub fn is_empty(&self) -> bool
[src]
Check if there are any matched patterns
pub fn len(&self) -> usize
[src]
Check number of extracted parameters
pub fn get(&'a self, key: &str) -> Option<&'a str>
[src]
Get matched parameter by name without type conversion
pub fn query<T: FromParam>(
&'a self,
key: &str
) -> Result<T, <T as FromParam>::Err>
[src]
&'a self,
key: &str
) -> Result<T, <T as FromParam>::Err>
Get matched FromParam
compatible parameter by name.
If keyed parameter is not available empty string is used as default value.
fn index(req: HttpRequest) -> Result<String> { let ivalue: isize = req.match_info().query("val")?; Ok(format!("isuze value: {:?}", ivalue)) }
ⓘImportant traits for Iter<'a, T>pub fn iter(&self) -> Iter<(Cow<'a, str>, Cow<'a, str>)>
[src]
ⓘImportant traits for Iter<'a, T>
Return iterator to items in parameter container
Trait Implementations
impl<'a> Debug for Params<'a>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a, 'b, 'c: 'a> Index<&'b str> for &'c Params<'a>
[src]
type Output = str
The returned type after indexing.
fn index(&self, name: &'b str) -> &str
[src]
Performs the indexing (container[index]
) operation.