pub struct Path<T>(pub T);Expand description
Extracts a single path parameter from the URL.
Parses a path segment into the specified type T.
Returns 400 Bad Request if parsing fails.
§Examples
ⓘ
use rapina::prelude::*;
#[get("/users/:id")]
async fn get_user(id: Path<u64>) -> String {
format!("User ID: {}", *id) // deref to access value of Path
}Tuple Fields§
§0: TImplementations§
Source§impl<T> Path<T>
impl<T> Path<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the extractor and returns the inner value.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Path<T>where
T: Freeze,
impl<T> RefUnwindSafe for Path<T>where
T: RefUnwindSafe,
impl<T> Send for Path<T>where
T: Send,
impl<T> Sync for Path<T>where
T: Sync,
impl<T> Unpin for Path<T>where
T: Unpin,
impl<T> UnsafeUnpin for Path<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Path<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more