[−][src]Struct hyperbole::tree::PathSpec
A uri specification and well-typed parameter parser.
See the path! macro for usage details.
Implementations
impl PathSpec<HNil>[src]
impl<P> PathSpec<P>[src]
pub fn segment(self, name: &'static str) -> Self[src]
Append a static segment to this spec.
Panics
This panics if the segment contains /, or if the path spec already contains a
catch-all parameter.
pub fn dynamic<T: FromStr>(
self,
name: &'static str
) -> PathSpec<<P as Add<HCons<T, HNil>>>::Output> where
P: Add<HCons<T, HNil>>, [src]
self,
name: &'static str
) -> PathSpec<<P as Add<HCons<T, HNil>>>::Output> where
P: Add<HCons<T, HNil>>,
Append a dynamic path parameter of type T to this spec.
Panics
This panics if the path spec already contains a catch-all parameter.
pub fn catch_all<T: FromStr>(
self,
name: &'static str
) -> PathSpec<<P as Add<HCons<T, HNil>>>::Output> where
P: Add<HCons<T, HNil>>, [src]
self,
name: &'static str
) -> PathSpec<<P as Add<HCons<T, HNil>>>::Output> where
P: Add<HCons<T, HNil>>,
Append a catch-all path parameter of type T to this spec.
Panics
This panics if the path spec already contains a catch-all parameter.
pub fn query<T: FromStr>(
self,
name: &'static str
) -> PathSpec<<P as Add<HCons<T, HNil>>>::Output> where
P: Add<HCons<T, HNil>>, [src]
self,
name: &'static str
) -> PathSpec<<P as Add<HCons<T, HNil>>>::Output> where
P: Add<HCons<T, HNil>>,
Add a query parameter of type T to this spec.
Panics
This panics if the path spec already contains a query parameter with the same name.
Trait Implementations
impl<P> Clone for PathSpec<P>[src]
fn clone(&self) -> Self[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<P> Display for PathSpec<P>[src]
fn fmt(&self, f: &mut Formatter) -> Result[src]
use hyperbole::path; use std::fmt::Display; fn eq<D: Display>(a: &str, b: D) { assert_eq!(a, format!("{}", b)); } eq("/", path![]); eq("/", path![? p1: u8]); eq("/one/:two/three", path!["one" / two: u32 / "three"]); eq("/one/:two/three", path!["one" / two: u32 / "three" ? p1: u8]); eq("/one/:two/*three", path!["one" / two: u32 / *three: String]); eq("/one/:two/*three", path!["one" / two: u32 / *three: String ? p1: u8]);
Auto Trait Implementations
impl<P> RefUnwindSafe for PathSpec<P>
impl<P> Send for PathSpec<P>
impl<P> Sync for PathSpec<P>
impl<P> Unpin for PathSpec<P>
impl<P> UnwindSafe for PathSpec<P>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices[src]
type Remainder = Choices
fn subset(
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>[src]
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>, [src]
U: LiftFrom<T, I>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<Source> Sculptor<HNil, HNil> for Source[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,