[][src]Function warp::filters::path::path

pub fn path(
    p: &'static str
) -> impl Filter<Extract = (), Error = Rejection> + Copy

Create an exact match path segment Filter.

This will try to match exactly to the current request path segment.

Panics

Exact path filters cannot be empty, or contain slashes.

Example

use warp::Filter;

// Matches '/hello'
let hello = warp::path("hello")
    .map(|| "Hello, World!");