pub struct Path<T>(pub T);Expand description
Typed path parameters, deserialized with serde.
T can be a single value (Path<u32>), a tuple (Path<(u32, String)>) or a struct
whose field names match the parameter names. Optional parameters ({?lang}) need an
Option<_>. A parameter that fails to parse results in a 404; use a
matcher to try other routes instead.
In a layout’s load, only the parameters of its router’s prefix are available.
Tuple Fields§
§0: TTrait Implementations§
impl<T: Copy> Copy for Path<T>
impl<T: Eq> Eq for Path<T>
Source§impl<S, T: DeserializeOwned> FromRequest<S> for Path<T>
impl<S, T: DeserializeOwned> FromRequest<S> for Path<T>
impl<T: PartialEq> StructuralPartialEq for Path<T>
Auto Trait Implementations§
impl<T> Forget for Path<T>
impl<T> Freeze for Path<T>where
T: Freeze,
impl<T> Move for Path<T>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more