# actix_web::dev::Params - Rust
API documentation for the Rust `Params` struct in crate `actix_web`.
Keywords: rust, rustlang, rust-lang, Params

# Struct actix_web::dev::Params [−] [src]

    pub struct Params { /* fields omitted */ }

Route match information

If resource path contains variable patterns, `Params` stores this variables.

## Methods

###

`impl Params`

[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(&self, key: &str) -> Option<&str>`

[src]

Get matched parameter by name without type conversion

####

`pub fn unprocessed(&self) -> &str`

[src]

Get unprocessed part of path

####

`pub fn query<T: FromParam>(&self, key: &str) -> Result<T, <T as FromParam>::Err>`

[src]

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))
    }

####

`pub fn iter(&self) -> ParamsIter`

[src]

Return iterator to items in parameter container

## Trait Implementations

###

`impl Debug for Params`

[src]

####

`fn fmt(&self, f: &mut Formatter) -> Result`

[src]

Formats the value using the given formatter. Read more

###

`impl Clone for Params`

[src]

####

`fn clone(&self) -> Params`

[src]

Returns a copy of the value. Read more

####

`fn clone_from(&mut self, source: &Self)`

1.0.0
[src]

Performs copy-assignment from `source`. Read more

###

`impl<'a> Index<&'a str> for Params`

[src]

#### `type Output = str`

The returned type after indexing.

####

`fn index(&self, name: &'a str) -> &str`

[src]

Performs the indexing (`container[index]`) operation.

###

`impl Index<usize> for Params`

[src]

#### `type Output = str`

The returned type after indexing.

####

`fn index(&self, idx: usize) -> &str`

[src]

Performs the indexing (`container[index]`) operation.

## Auto Trait Implementations

###

`impl !Send for Params`

###

`impl !Sync for Params`

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)