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

    pub struct ResourceInfo { /* fields omitted */ }

Information about current resource

## Methods

###

`impl ResourceInfo`

[src]

####

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

[src]

Name os the resource

####

`pub fn rdef(&self) -> Option<&ResourceDef>`

[src]

This method returns reference to matched `ResourceDef` object.

####

`pub fn match_info(&self) -> &Params`

[src]

Get a reference to the Params object.

Params is a container for url parameters. A variable segment is specified in the form `{identifier}`, where the identifier can be used later in a request handler to access the matched value for that segment.

####

`pub fn url_for<U, I>( &self, req: &Request, name: &str, elements: U ) -> Result<Url, UrlGenerationError> where U: IntoIterator<Item = I>, I: AsRef<str>,`

[src]

Generate url for named resource

Check [`HttpRequest::url_for()`](../struct.HttpRequest.html#method. url_for) for detailed information.

####

`pub fn has_resource(&self, path: &str) -> bool`

[src]

Check if application contains matching resource.

This method does not take `prefix` into account. For example if prefix is `/test` and router contains route `/name`, following path would be recognizable `/test/name` but `has_resource()` call would return `false`.

####

`pub fn has_prefixed_resource(&self, path: &str) -> bool`

[src]

Check if application contains matching resource.

This method does take `prefix` into account but behaves like `has_route` in case `prefix` is not set in the router.

For example if prefix is `/test` and router contains route `/name`, the following path would be recognizable `/test/name` and `has_prefixed_route()` call would return `true`. It will not match against prefix in case it's not given. For example for `/name` with a `/test` prefix would return `false`

## Trait Implementations

###

`impl Clone for ResourceInfo`

[src]

####

`fn clone(&self) -> ResourceInfo`

[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

## Auto Trait Implementations

###

`impl !Send for ResourceInfo`

###

`impl !Sync for ResourceInfo`

## Blanket Implementations

###

`impl<T> ToOwned for T where T: Clone,`

[src]

#### `type Owned = T`

####

`fn to_owned(&self) -> T`

[src]

Creates owned data from borrowed data, usually by cloning. Read more

####

`fn clone_into(&self, target: &mut T)`

[src]

🔬 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]

####

`fn from(t: T) -> T`

[src]

Performs the conversion.

###

`impl<T, U> Into for T where U: From<T>,`

[src]

####

`fn into(self) -> U`

[src]

Performs the conversion.

###

`impl<T, U> TryFrom for T where T: From<U>,`

[src]

#### `type Error = !`

🔬 This is a nightly-only experimental API. (`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]

🔬 This is a nightly-only experimental API. (`try_from`)

Performs the conversion.

###

`impl<T> Borrow for T where T: ?Sized,`

[src]

####

`fn borrow(&self) -> &T`

[src]

Immutably borrows from an owned value. Read more

###

`impl<T> BorrowMut for T where T: ?Sized,`

[src]

####

`fn borrow_mut(&mut self) -> &mut T`

[src]

Mutably borrows from an owned value. Read more

###

`impl<T, U> TryInto for T where U: TryFrom<T>,`

[src]

#### `type Error = <U as TryFrom<T>>::Error`

🔬 This is a nightly-only experimental API. (`try_from`)

The type returned in the event of a conversion error.

####

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

[src]

🔬 This is a nightly-only experimental API. (`try_from`)

Performs the conversion.

###

`impl<T> Any for T where T: 'static + ?Sized,`

[src]

####

`fn get_type_id(&self) -> TypeId`

[src]

🔬 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`

# 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`)