rocket::http::uri::fmt

Trait FromUriParam

Source
pub trait FromUriParam<P, T>
where P: Part,
{ type Target: UriDisplay<P>; // Required method fn from_uri_param(param: T) -> Self::Target; }
Expand description

Conversion trait for parameters used in uri! invocations.

§Overview

In addition to implementing UriDisplay, to use a custom type in a uri! expression, the FromUriParam trait must be implemented. The UriDisplay derive automatically generates identity implementations of FromUriParam, so in the majority of cases, as with UriDisplay, this trait is never implemented manually.

In the rare case that UriDisplay is implemented manually, this trait, too, must be implemented explicitly. In the majority of cases, implementation can be automated. Rocket provides impl_from_uri_param_identity! to generate the identity implementations automatically. For a type T, these are:

  • impl<P: Part> FromUriParam<P, T> for T
  • impl<'x, P: Part> FromUriParam<P, &'x T> for T
  • impl<'x, P: Part> FromUriParam<P, &'x mut T> for T

See impl_from_uri_param_identity! for usage details.

§Code Generation

This trait is invoked once per expression passed into a uri! invocation. In particular, for a route URI parameter of type T and a user-supplied expression e of type S, <T as FromUriParam<S>>::from_uri_param(e) is invoked. The returned value of type T::Target is used in place of the user’s value and rendered using its UriDisplay implementation.

This trait allows types that differ from the route URI parameter’s types to be used in their place at no cost. For instance, the following implementation, provided by Rocket, allows an &str to be used in a uri! invocation for route URI parameters declared as String:

impl<'a, P: Part> FromUriParam<P, &'a str> for String {
    type Target = &'a str;
}

Because the FromUriParam::Target type is the same as the input type, the conversion is a no-op and free of cost, allowing an &str to be used in place of a String without penalty.

§Provided Implementations

The following types have identity implementations:

  • String, i8, i16, i32, i64, i128, isize, u8, u16, u32, u64, u128, usize, f32, f64, bool, IpAddr, Ipv4Addr, Ipv6Addr, &str, Cow<str>

The following types have identity implementations only in Path:

  • &Path, PathBuf

The following types have identity implementations only in Query:

  • Option<T>, Result<T, E>

The following conversions are implemented for both paths and queries, allowing a value of the type on the left to be used when a type on the right is expected by a route:

  • &str to String
  • String to &str
  • T to Form<T>

The following conversions are implemented only in Path:

  • &str to &Path
  • &str to PathBuf
  • PathBuf to &Path
  • T to Option<T>
  • T to Result<T, E>

The following conversions are implemented only in Query:

  • Option<T> to Result<T, E> (for any E)
  • Result<T, E> to Option<T> (for any E)

See Foreign Impls for all provided implementations.

§Implementing

This trait should only be implemented when you’d like to allow a type different from the route’s declared type to be used in its place in a uri! invocation. For instance, if the route has a type of T and you’d like to use a type of S in a uri! invocation, you’d implement FromUriParam<P, T> for S where P is Path for conversions valid in the path part of a URI, Uri for conversions valid in the query part of a URI, or P: Part when a conversion is valid in either case.

This is typically only warranted for owned-value types with corresponding reference types: String and &str, for instance. In this case, it’s desirable to allow an &str to be used in place of a String.

When implementing FromUriParam, be aware that Rocket will use the UriDisplay implementation of FromUriParam::Target, not of the source type. Incorrect implementations can result in creating unsafe URIs.

§Example

The following example implements FromUriParam<Query, (&str, &str)> for a User type. The implementation allows an (&str, &str) type to be used in a uri! invocation where a User type is expected in the query part of the URI.

use std::fmt;

use rocket::http::uri::fmt::{Formatter, UriDisplay, FromUriParam, Query};

#[derive(FromForm)]
struct User<'a> {
    name: &'a str,
    nickname: String,
}

impl UriDisplay<Query> for User<'_> {
    fn fmt(&self, f: &mut Formatter<Query>) -> fmt::Result {
        f.write_named_value("name", &self.name)?;
        f.write_named_value("nickname", &self.nickname)
    }
}

impl<'a, 'b> FromUriParam<Query, (&'a str, &'b str)> for User<'a> {
    type Target = User<'a>;

    fn from_uri_param((name, nickname): (&'a str, &'b str)) -> User<'a> {
        User { name: name.into(), nickname: nickname.to_string() }
    }
}

With these implementations, the following typechecks:

#[post("/<name>?<user..>")]
fn some_route(name: &str, user: User<'_>)  { /* .. */ }

let uri = uri!(some_route(name = "hey", user = ("Robert Mike", "Bob")));
assert_eq!(uri.path(), "/hey");
assert_eq!(uri.query().unwrap(), "name=Robert%20Mike&nickname=Bob");

Required Associated Types§

Source

type Target: UriDisplay<P>

The resulting type of this conversion.

Required Methods§

Source

fn from_uri_param(param: T) -> Self::Target

Converts a value of type T into a value of type Self::Target. The resulting value of type Self::Target will be rendered into a URI using its UriDisplay implementation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromUriParam<Path, PathBuf> for PathBuf

Source§

impl<'a> FromUriParam<Path, &'a str> for PathBuf

A no cost conversion allowing an &str to be used in place of a PathBuf.

Source§

type Target = &'a Path

Source§

fn from_uri_param(param: &'a str) -> &'a Path

Source§

impl<'a> FromUriParam<Path, &'a Path> for &'a Path

Source§

type Target = &'a Path

Source§

fn from_uri_param(param: &'a Path) -> &'a Path

Source§

impl<'a> FromUriParam<Path, &'a Path> for PathBuf

Source§

type Target = &'a Path

Source§

fn from_uri_param(param: &'a Path) -> &'a Path

Source§

impl<'a> FromUriParam<Path, PathBuf> for &'a Path

Source§

impl<'a> FromUriParam<Query, &'a [u8]> for &'a [u8]

Source§

type Target = &'a [u8]

Source§

fn from_uri_param(param: &'a [u8]) -> &'a [u8]

Source§

impl<'a, 'b> FromUriParam<Path, &'a &'b str> for PathBuf

A no cost conversion allowing an &&str to be used in place of a PathBuf.

Source§

type Target = &'b Path

Source§

fn from_uri_param(param: &'a &'b str) -> &'b Path

Source§

impl<'a, K, V, A, B> FromUriParam<Query, &'a BTreeMap<A, B>> for BTreeMap<K, V>

Source§

type Target = &'a BTreeMap<A, B>

Source§

fn from_uri_param( param: &'a BTreeMap<A, B>, ) -> <BTreeMap<K, V> as FromUriParam<Query, &'a BTreeMap<A, B>>>::Target

Source§

impl<'a, K, V, A, B> FromUriParam<Query, &'a BTreeMap<A, B>> for HashMap<K, V>

Source§

type Target = &'a BTreeMap<A, B>

Source§

fn from_uri_param( param: &'a BTreeMap<A, B>, ) -> <HashMap<K, V> as FromUriParam<Query, &'a BTreeMap<A, B>>>::Target

Source§

impl<'a, K, V, A, B> FromUriParam<Query, &'a HashMap<A, B>> for BTreeMap<K, V>

Source§

type Target = &'a HashMap<A, B>

Source§

fn from_uri_param( param: &'a HashMap<A, B>, ) -> <BTreeMap<K, V> as FromUriParam<Query, &'a HashMap<A, B>>>::Target

Source§

impl<'a, K, V, A, B> FromUriParam<Query, &'a HashMap<A, B>> for HashMap<K, V>

Source§

type Target = &'a HashMap<A, B>

Source§

fn from_uri_param( param: &'a HashMap<A, B>, ) -> <HashMap<K, V> as FromUriParam<Query, &'a HashMap<A, B>>>::Target

Source§

impl<'a, K, V, A, B> FromUriParam<Query, &'a mut BTreeMap<A, B>> for BTreeMap<K, V>

Source§

type Target = &'a BTreeMap<A, B>

Source§

fn from_uri_param( param: &'a mut BTreeMap<A, B>, ) -> <BTreeMap<K, V> as FromUriParam<Query, &'a mut BTreeMap<A, B>>>::Target

Source§

impl<'a, K, V, A, B> FromUriParam<Query, &'a mut BTreeMap<A, B>> for HashMap<K, V>

Source§

type Target = &'a BTreeMap<A, B>

Source§

fn from_uri_param( param: &'a mut BTreeMap<A, B>, ) -> <HashMap<K, V> as FromUriParam<Query, &'a mut BTreeMap<A, B>>>::Target

Source§

impl<'a, K, V, A, B> FromUriParam<Query, &'a mut HashMap<A, B>> for BTreeMap<K, V>

Source§

type Target = &'a HashMap<A, B>

Source§

fn from_uri_param( param: &'a mut HashMap<A, B>, ) -> <BTreeMap<K, V> as FromUriParam<Query, &'a mut HashMap<A, B>>>::Target

Source§

impl<'a, K, V, A, B> FromUriParam<Query, &'a mut HashMap<A, B>> for HashMap<K, V>

Source§

type Target = &'a HashMap<A, B>

Source§

fn from_uri_param( param: &'a mut HashMap<A, B>, ) -> <HashMap<K, V> as FromUriParam<Query, &'a mut HashMap<A, B>>>::Target

Source§

impl<'a, P> FromUriParam<P, &'a str> for &'a str
where P: Part,

Source§

type Target = &'a str

Source§

fn from_uri_param(param: &'a str) -> &'a str

Source§

impl<'a, P> FromUriParam<P, &'a str> for String
where P: Part,

Source§

type Target = &'a str

Source§

fn from_uri_param(param: &'a str) -> &'a str

Source§

impl<'a, P> FromUriParam<P, Cow<'a, str>> for Cow<'a, str>
where P: Part,

Source§

type Target = Cow<'a, str>

Source§

fn from_uri_param(param: Cow<'a, str>) -> Cow<'a, str>

Source§

impl<'a, P> FromUriParam<P, String> for &'a str
where P: Part,

Source§

impl<'x> FromUriParam<Path, &'x PathBuf> for PathBuf

Source§

impl<'x> FromUriParam<Path, &'x mut PathBuf> for PathBuf

Source§

type Target = &'x mut PathBuf

Source§

fn from_uri_param(param: &'x mut PathBuf) -> &'x mut PathBuf

Source§

impl<'x, 'a> FromUriParam<Path, &'x &'a Path> for &'a Path

Source§

type Target = &'x &'a Path

Source§

fn from_uri_param(param: &'x &'a Path) -> &'x &'a Path

Source§

impl<'x, 'a> FromUriParam<Path, &'x &'a Path> for PathBuf

Source§

type Target = &'x &'a Path

Source§

fn from_uri_param(param: &'x &'a Path) -> &'x &'a Path

Source§

impl<'x, 'a> FromUriParam<Path, &'x PathBuf> for &'a Path

Source§

impl<'x, 'a> FromUriParam<Path, &'x mut &'a Path> for &'a Path

Source§

type Target = &'x mut &'a Path

Source§

fn from_uri_param(param: &'x mut &'a Path) -> &'x mut &'a Path

Source§

impl<'x, 'a> FromUriParam<Path, &'x mut &'a Path> for PathBuf

Source§

type Target = &'x mut &'a Path

Source§

fn from_uri_param(param: &'x mut &'a Path) -> &'x mut &'a Path

Source§

impl<'x, 'a> FromUriParam<Path, &'x mut PathBuf> for &'a Path

Source§

type Target = &'x mut PathBuf

Source§

fn from_uri_param(param: &'x mut PathBuf) -> &'x mut PathBuf

Source§

impl<'x, 'a> FromUriParam<Query, &'x &'a [u8]> for &'a [u8]

Source§

type Target = &'x &'a [u8]

Source§

fn from_uri_param(param: &'x &'a [u8]) -> &'x &'a [u8]

Source§

impl<'x, 'a> FromUriParam<Query, &'x mut &'a [u8]> for &'a [u8]

Source§

type Target = &'x mut &'a [u8]

Source§

fn from_uri_param(param: &'x mut &'a [u8]) -> &'x mut &'a [u8]

Source§

impl<'x, 'a, P> FromUriParam<P, &'x &'a str> for &'a str
where P: Part,

Source§

type Target = &'x &'a str

Source§

fn from_uri_param(param: &'x &'a str) -> &'x &'a str

Source§

impl<'x, 'a, P> FromUriParam<P, &'x &'a str> for String
where P: Part,

Source§

type Target = &'x &'a str

Source§

fn from_uri_param(param: &'x &'a str) -> &'x &'a str

Source§

impl<'x, 'a, P> FromUriParam<P, &'x Cow<'a, str>> for Cow<'a, str>
where P: Part,

Source§

type Target = &'x Cow<'a, str>

Source§

fn from_uri_param(param: &'x Cow<'a, str>) -> &'x Cow<'a, str>

Source§

impl<'x, 'a, P> FromUriParam<P, &'x String> for &'a str
where P: Part,

Source§

type Target = &'x String

Source§

fn from_uri_param(param: &'x String) -> &'x String

Source§

impl<'x, 'a, P> FromUriParam<P, &'x mut &'a str> for &'a str
where P: Part,

Source§

type Target = &'x mut &'a str

Source§

fn from_uri_param(param: &'x mut &'a str) -> &'x mut &'a str

Source§

impl<'x, 'a, P> FromUriParam<P, &'x mut &'a str> for String
where P: Part,

Source§

type Target = &'x mut &'a str

Source§

fn from_uri_param(param: &'x mut &'a str) -> &'x mut &'a str

Source§

impl<'x, 'a, P> FromUriParam<P, &'x mut Cow<'a, str>> for Cow<'a, str>
where P: Part,

Source§

type Target = &'x mut Cow<'a, str>

Source§

fn from_uri_param(param: &'x mut Cow<'a, str>) -> &'x mut Cow<'a, str>

Source§

impl<'x, 'a, P> FromUriParam<P, &'x mut String> for &'a str
where P: Part,

Source§

type Target = &'x mut String

Source§

fn from_uri_param(param: &'x mut String) -> &'x mut String

Source§

impl<'x, P> FromUriParam<P, &'x IpAddr> for IpAddr
where P: Part,

Source§

type Target = &'x IpAddr

Source§

fn from_uri_param(param: &'x IpAddr) -> &'x IpAddr

Source§

impl<'x, P> FromUriParam<P, &'x SocketAddr> for SocketAddr
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x bool> for bool
where P: Part,

Source§

type Target = &'x bool

Source§

fn from_uri_param(param: &'x bool) -> &'x bool

Source§

impl<'x, P> FromUriParam<P, &'x f32> for f32
where P: Part,

Source§

type Target = &'x f32

Source§

fn from_uri_param(param: &'x f32) -> &'x f32

Source§

impl<'x, P> FromUriParam<P, &'x f64> for f64
where P: Part,

Source§

type Target = &'x f64

Source§

fn from_uri_param(param: &'x f64) -> &'x f64

Source§

impl<'x, P> FromUriParam<P, &'x i8> for i8
where P: Part,

Source§

type Target = &'x i8

Source§

fn from_uri_param(param: &'x i8) -> &'x i8

Source§

impl<'x, P> FromUriParam<P, &'x i16> for i16
where P: Part,

Source§

type Target = &'x i16

Source§

fn from_uri_param(param: &'x i16) -> &'x i16

Source§

impl<'x, P> FromUriParam<P, &'x i32> for i32
where P: Part,

Source§

type Target = &'x i32

Source§

fn from_uri_param(param: &'x i32) -> &'x i32

Source§

impl<'x, P> FromUriParam<P, &'x i64> for i64
where P: Part,

Source§

type Target = &'x i64

Source§

fn from_uri_param(param: &'x i64) -> &'x i64

Source§

impl<'x, P> FromUriParam<P, &'x i128> for i128
where P: Part,

Source§

type Target = &'x i128

Source§

fn from_uri_param(param: &'x i128) -> &'x i128

Source§

impl<'x, P> FromUriParam<P, &'x isize> for isize
where P: Part,

Source§

type Target = &'x isize

Source§

fn from_uri_param(param: &'x isize) -> &'x isize

Source§

impl<'x, P> FromUriParam<P, &'x u8> for u8
where P: Part,

Source§

type Target = &'x u8

Source§

fn from_uri_param(param: &'x u8) -> &'x u8

Source§

impl<'x, P> FromUriParam<P, &'x u16> for u16
where P: Part,

Source§

type Target = &'x u16

Source§

fn from_uri_param(param: &'x u16) -> &'x u16

Source§

impl<'x, P> FromUriParam<P, &'x u32> for u32
where P: Part,

Source§

type Target = &'x u32

Source§

fn from_uri_param(param: &'x u32) -> &'x u32

Source§

impl<'x, P> FromUriParam<P, &'x u64> for u64
where P: Part,

Source§

type Target = &'x u64

Source§

fn from_uri_param(param: &'x u64) -> &'x u64

Source§

impl<'x, P> FromUriParam<P, &'x u128> for u128
where P: Part,

Source§

type Target = &'x u128

Source§

fn from_uri_param(param: &'x u128) -> &'x u128

Source§

impl<'x, P> FromUriParam<P, &'x usize> for usize
where P: Part,

Source§

type Target = &'x usize

Source§

fn from_uri_param(param: &'x usize) -> &'x usize

Source§

impl<'x, P> FromUriParam<P, &'x Date> for Date
where P: Part,

Source§

type Target = &'x Date

Source§

fn from_uri_param(param: &'x Date) -> &'x Date

Source§

impl<'x, P> FromUriParam<P, &'x PrimitiveDateTime> for PrimitiveDateTime
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x Time> for Time
where P: Part,

Source§

type Target = &'x Time

Source§

fn from_uri_param(param: &'x Time) -> &'x Time

Source§

impl<'x, P> FromUriParam<P, &'x String> for String
where P: Part,

Source§

type Target = &'x String

Source§

fn from_uri_param(param: &'x String) -> &'x String

Source§

impl<'x, P> FromUriParam<P, &'x Ipv4Addr> for Ipv4Addr
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x Ipv6Addr> for Ipv6Addr
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x SocketAddrV4> for SocketAddrV4
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x SocketAddrV6> for SocketAddrV6
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<i8>> for NonZero<i8>
where P: Part,

Source§

type Target = &'x NonZero<i8>

Source§

fn from_uri_param(param: &'x NonZero<i8>) -> &'x NonZero<i8>

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<i16>> for NonZero<i16>
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<i32>> for NonZero<i32>
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<i64>> for NonZero<i64>
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<i128>> for NonZero<i128>
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<isize>> for NonZero<isize>
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<u8>> for NonZero<u8>
where P: Part,

Source§

type Target = &'x NonZero<u8>

Source§

fn from_uri_param(param: &'x NonZero<u8>) -> &'x NonZero<u8>

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<u16>> for NonZero<u16>
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<u32>> for NonZero<u32>
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<u64>> for NonZero<u64>
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<u128>> for NonZero<u128>
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x NonZero<usize>> for NonZero<usize>
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x mut IpAddr> for IpAddr
where P: Part,

Source§

type Target = &'x mut IpAddr

Source§

fn from_uri_param(param: &'x mut IpAddr) -> &'x mut IpAddr

Source§

impl<'x, P> FromUriParam<P, &'x mut SocketAddr> for SocketAddr
where P: Part,

Source§

type Target = &'x mut SocketAddr

Source§

fn from_uri_param(param: &'x mut SocketAddr) -> &'x mut SocketAddr

Source§

impl<'x, P> FromUriParam<P, &'x mut bool> for bool
where P: Part,

Source§

type Target = &'x mut bool

Source§

fn from_uri_param(param: &'x mut bool) -> &'x mut bool

Source§

impl<'x, P> FromUriParam<P, &'x mut f32> for f32
where P: Part,

Source§

type Target = &'x mut f32

Source§

fn from_uri_param(param: &'x mut f32) -> &'x mut f32

Source§

impl<'x, P> FromUriParam<P, &'x mut f64> for f64
where P: Part,

Source§

type Target = &'x mut f64

Source§

fn from_uri_param(param: &'x mut f64) -> &'x mut f64

Source§

impl<'x, P> FromUriParam<P, &'x mut i8> for i8
where P: Part,

Source§

type Target = &'x mut i8

Source§

fn from_uri_param(param: &'x mut i8) -> &'x mut i8

Source§

impl<'x, P> FromUriParam<P, &'x mut i16> for i16
where P: Part,

Source§

type Target = &'x mut i16

Source§

fn from_uri_param(param: &'x mut i16) -> &'x mut i16

Source§

impl<'x, P> FromUriParam<P, &'x mut i32> for i32
where P: Part,

Source§

type Target = &'x mut i32

Source§

fn from_uri_param(param: &'x mut i32) -> &'x mut i32

Source§

impl<'x, P> FromUriParam<P, &'x mut i64> for i64
where P: Part,

Source§

type Target = &'x mut i64

Source§

fn from_uri_param(param: &'x mut i64) -> &'x mut i64

Source§

impl<'x, P> FromUriParam<P, &'x mut i128> for i128
where P: Part,

Source§

type Target = &'x mut i128

Source§

fn from_uri_param(param: &'x mut i128) -> &'x mut i128

Source§

impl<'x, P> FromUriParam<P, &'x mut isize> for isize
where P: Part,

Source§

type Target = &'x mut isize

Source§

fn from_uri_param(param: &'x mut isize) -> &'x mut isize

Source§

impl<'x, P> FromUriParam<P, &'x mut u8> for u8
where P: Part,

Source§

type Target = &'x mut u8

Source§

fn from_uri_param(param: &'x mut u8) -> &'x mut u8

Source§

impl<'x, P> FromUriParam<P, &'x mut u16> for u16
where P: Part,

Source§

type Target = &'x mut u16

Source§

fn from_uri_param(param: &'x mut u16) -> &'x mut u16

Source§

impl<'x, P> FromUriParam<P, &'x mut u32> for u32
where P: Part,

Source§

type Target = &'x mut u32

Source§

fn from_uri_param(param: &'x mut u32) -> &'x mut u32

Source§

impl<'x, P> FromUriParam<P, &'x mut u64> for u64
where P: Part,

Source§

type Target = &'x mut u64

Source§

fn from_uri_param(param: &'x mut u64) -> &'x mut u64

Source§

impl<'x, P> FromUriParam<P, &'x mut u128> for u128
where P: Part,

Source§

type Target = &'x mut u128

Source§

fn from_uri_param(param: &'x mut u128) -> &'x mut u128

Source§

impl<'x, P> FromUriParam<P, &'x mut usize> for usize
where P: Part,

Source§

type Target = &'x mut usize

Source§

fn from_uri_param(param: &'x mut usize) -> &'x mut usize

Source§

impl<'x, P> FromUriParam<P, &'x mut Date> for Date
where P: Part,

Source§

type Target = &'x mut Date

Source§

fn from_uri_param(param: &'x mut Date) -> &'x mut Date

Source§

impl<'x, P> FromUriParam<P, &'x mut PrimitiveDateTime> for PrimitiveDateTime
where P: Part,

Source§

impl<'x, P> FromUriParam<P, &'x mut Time> for Time
where P: Part,

Source§

type Target = &'x mut Time

Source§

fn from_uri_param(param: &'x mut Time) -> &'x mut Time

Source§

impl<'x, P> FromUriParam<P, &'x mut String> for String
where P: Part,

Source§

type Target = &'x mut String

Source§

fn from_uri_param(param: &'x mut String) -> &'x mut String

Source§

impl<'x, P> FromUriParam<P, &'x mut Ipv4Addr> for Ipv4Addr
where P: Part,

Source§

type Target = &'x mut Ipv4Addr

Source§

fn from_uri_param(param: &'x mut Ipv4Addr) -> &'x mut Ipv4Addr

Source§

impl<'x, P> FromUriParam<P, &'x mut Ipv6Addr> for Ipv6Addr
where P: Part,

Source§

type Target = &'x mut Ipv6Addr

Source§

fn from_uri_param(param: &'x mut Ipv6Addr) -> &'x mut Ipv6Addr

Source§

impl<'x, P> FromUriParam<P, &'x mut SocketAddrV4> for SocketAddrV4
where P: Part,

Source§

type Target = &'x mut SocketAddrV4

Source§

fn from_uri_param(param: &'x mut SocketAddrV4) -> &'x mut SocketAddrV4

Source§

impl<'x, P> FromUriParam<P, &'x mut SocketAddrV6> for SocketAddrV6
where P: Part,

Source§

type Target = &'x mut SocketAddrV6

Source§

fn from_uri_param(param: &'x mut SocketAddrV6) -> &'x mut SocketAddrV6

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<i8>> for NonZero<i8>
where P: Part,

Source§

type Target = &'x mut NonZero<i8>

Source§

fn from_uri_param(param: &'x mut NonZero<i8>) -> &'x mut NonZero<i8>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<i16>> for NonZero<i16>
where P: Part,

Source§

type Target = &'x mut NonZero<i16>

Source§

fn from_uri_param(param: &'x mut NonZero<i16>) -> &'x mut NonZero<i16>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<i32>> for NonZero<i32>
where P: Part,

Source§

type Target = &'x mut NonZero<i32>

Source§

fn from_uri_param(param: &'x mut NonZero<i32>) -> &'x mut NonZero<i32>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<i64>> for NonZero<i64>
where P: Part,

Source§

type Target = &'x mut NonZero<i64>

Source§

fn from_uri_param(param: &'x mut NonZero<i64>) -> &'x mut NonZero<i64>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<i128>> for NonZero<i128>
where P: Part,

Source§

type Target = &'x mut NonZero<i128>

Source§

fn from_uri_param(param: &'x mut NonZero<i128>) -> &'x mut NonZero<i128>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<isize>> for NonZero<isize>
where P: Part,

Source§

type Target = &'x mut NonZero<isize>

Source§

fn from_uri_param(param: &'x mut NonZero<isize>) -> &'x mut NonZero<isize>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<u8>> for NonZero<u8>
where P: Part,

Source§

type Target = &'x mut NonZero<u8>

Source§

fn from_uri_param(param: &'x mut NonZero<u8>) -> &'x mut NonZero<u8>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<u16>> for NonZero<u16>
where P: Part,

Source§

type Target = &'x mut NonZero<u16>

Source§

fn from_uri_param(param: &'x mut NonZero<u16>) -> &'x mut NonZero<u16>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<u32>> for NonZero<u32>
where P: Part,

Source§

type Target = &'x mut NonZero<u32>

Source§

fn from_uri_param(param: &'x mut NonZero<u32>) -> &'x mut NonZero<u32>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<u64>> for NonZero<u64>
where P: Part,

Source§

type Target = &'x mut NonZero<u64>

Source§

fn from_uri_param(param: &'x mut NonZero<u64>) -> &'x mut NonZero<u64>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<u128>> for NonZero<u128>
where P: Part,

Source§

type Target = &'x mut NonZero<u128>

Source§

fn from_uri_param(param: &'x mut NonZero<u128>) -> &'x mut NonZero<u128>

Source§

impl<'x, P> FromUriParam<P, &'x mut NonZero<usize>> for NonZero<usize>
where P: Part,

Source§

type Target = &'x mut NonZero<usize>

Source§

fn from_uri_param(param: &'x mut NonZero<usize>) -> &'x mut NonZero<usize>

Source§

impl<'x, T, A> FromUriParam<Query, &'x Vec<A>> for Vec<T>

Source§

type Target = &'x Vec<A>

Source§

fn from_uri_param(param: &'x Vec<A>) -> &'x Vec<A>

Source§

impl<'x, T, A> FromUriParam<Query, &'x mut Vec<A>> for Vec<T>

Source§

type Target = &'x mut Vec<A>

Source§

fn from_uri_param(param: &'x mut Vec<A>) -> &'x mut Vec<A>

Source§

impl<'x, T, A, const N: usize> FromUriParam<Query, &'x [A; N]> for [T; N]

Source§

type Target = &'x [A; N]

Source§

fn from_uri_param(param: &'x [A; N]) -> &'x [A; N]

Source§

impl<'x, T, A, const N: usize> FromUriParam<Query, &'x [A; N]> for Vec<T>

Source§

type Target = &'x [A; N]

Source§

fn from_uri_param(param: &'x [A; N]) -> &'x [A; N]

Source§

impl<'x, T, A, const N: usize> FromUriParam<Query, &'x Vec<A>> for [T; N]

Source§

type Target = &'x Vec<A>

Source§

fn from_uri_param(param: &'x Vec<A>) -> &'x Vec<A>

Source§

impl<'x, T, A, const N: usize> FromUriParam<Query, &'x mut [A; N]> for [T; N]

Source§

type Target = &'x mut [A; N]

Source§

fn from_uri_param(param: &'x mut [A; N]) -> &'x mut [A; N]

Source§

impl<'x, T, A, const N: usize> FromUriParam<Query, &'x mut [A; N]> for Vec<T>

Source§

type Target = &'x mut [A; N]

Source§

fn from_uri_param(param: &'x mut [A; N]) -> &'x mut [A; N]

Source§

impl<'x, T, A, const N: usize> FromUriParam<Query, &'x mut Vec<A>> for [T; N]

Source§

type Target = &'x mut Vec<A>

Source§

fn from_uri_param(param: &'x mut Vec<A>) -> &'x mut Vec<A>

Source§

impl<A, E, T> FromUriParam<Path, A> for Result<T, E>
where T: FromUriParam<Path, A>,

A no cost conversion allowing T to be used in place of an Result<T, E>.

Source§

type Target = <T as FromUriParam<Path, A>>::Target

Source§

fn from_uri_param(param: A) -> <Result<T, E> as FromUriParam<Path, A>>::Target

Source§

impl<A, E, T> FromUriParam<Query, Option<A>> for Result<T, E>
where T: FromUriParam<Query, A>,

Source§

impl<A, E, T> FromUriParam<Query, Result<A, E>> for Option<T>
where T: FromUriParam<Query, A>,

Source§

type Target = Result<<T as FromUriParam<Query, A>>::Target, E>

Source§

fn from_uri_param( param: Result<A, E>, ) -> <Option<T> as FromUriParam<Query, Result<A, E>>>::Target

Source§

impl<A, E, T> FromUriParam<Query, Result<A, E>> for Result<T, E>
where T: FromUriParam<Query, A>,

Source§

type Target = Result<<T as FromUriParam<Query, A>>::Target, E>

Source§

fn from_uri_param( param: Result<A, E>, ) -> <Result<T, E> as FromUriParam<Query, Result<A, E>>>::Target

Source§

impl<A, T> FromUriParam<Path, A> for Option<T>
where T: FromUriParam<Path, A>,

A no cost conversion allowing any T to be used in place of an Option<T>.

Source§

impl<A, T> FromUriParam<Query, Option<A>> for Option<T>
where T: FromUriParam<Query, A>,

Source§

impl<K, V, A, B> FromUriParam<Query, BTreeMap<A, B>> for BTreeMap<K, V>

Source§

type Target = BTreeMap<A, B>

Source§

fn from_uri_param( param: BTreeMap<A, B>, ) -> <BTreeMap<K, V> as FromUriParam<Query, BTreeMap<A, B>>>::Target

Source§

impl<K, V, A, B> FromUriParam<Query, BTreeMap<A, B>> for HashMap<K, V>

Source§

type Target = BTreeMap<A, B>

Source§

fn from_uri_param( param: BTreeMap<A, B>, ) -> <HashMap<K, V> as FromUriParam<Query, BTreeMap<A, B>>>::Target

Source§

impl<K, V, A, B> FromUriParam<Query, HashMap<A, B>> for BTreeMap<K, V>

Source§

type Target = HashMap<A, B>

Source§

fn from_uri_param( param: HashMap<A, B>, ) -> <BTreeMap<K, V> as FromUriParam<Query, HashMap<A, B>>>::Target

Source§

impl<K, V, A, B> FromUriParam<Query, HashMap<A, B>> for HashMap<K, V>

Source§

type Target = HashMap<A, B>

Source§

fn from_uri_param( param: HashMap<A, B>, ) -> <HashMap<K, V> as FromUriParam<Query, HashMap<A, B>>>::Target

Source§

impl<P> FromUriParam<P, IpAddr> for IpAddr
where P: Part,

Source§

impl<P> FromUriParam<P, SocketAddr> for SocketAddr
where P: Part,

Source§

impl<P> FromUriParam<P, bool> for bool
where P: Part,

Source§

impl<P> FromUriParam<P, f32> for f32
where P: Part,

Source§

impl<P> FromUriParam<P, f64> for f64
where P: Part,

Source§

impl<P> FromUriParam<P, i8> for i8
where P: Part,

Source§

impl<P> FromUriParam<P, i16> for i16
where P: Part,

Source§

impl<P> FromUriParam<P, i32> for i32
where P: Part,

Source§

impl<P> FromUriParam<P, i64> for i64
where P: Part,

Source§

impl<P> FromUriParam<P, i128> for i128
where P: Part,

Source§

impl<P> FromUriParam<P, isize> for isize
where P: Part,

Source§

impl<P> FromUriParam<P, u8> for u8
where P: Part,

Source§

impl<P> FromUriParam<P, u16> for u16
where P: Part,

Source§

impl<P> FromUriParam<P, u32> for u32
where P: Part,

Source§

impl<P> FromUriParam<P, u64> for u64
where P: Part,

Source§

impl<P> FromUriParam<P, u128> for u128
where P: Part,

Source§

impl<P> FromUriParam<P, usize> for usize
where P: Part,

Source§

impl<P> FromUriParam<P, Date> for Date
where P: Part,

Source§

impl<P> FromUriParam<P, PrimitiveDateTime> for PrimitiveDateTime
where P: Part,

Source§

impl<P> FromUriParam<P, Time> for Time
where P: Part,

Source§

impl<P> FromUriParam<P, String> for String
where P: Part,

Source§

impl<P> FromUriParam<P, Ipv4Addr> for Ipv4Addr
where P: Part,

Source§

impl<P> FromUriParam<P, Ipv6Addr> for Ipv6Addr
where P: Part,

Source§

impl<P> FromUriParam<P, SocketAddrV4> for SocketAddrV4
where P: Part,

Source§

impl<P> FromUriParam<P, SocketAddrV6> for SocketAddrV6
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<i8>> for NonZero<i8>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<i16>> for NonZero<i16>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<i32>> for NonZero<i32>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<i64>> for NonZero<i64>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<i128>> for NonZero<i128>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<isize>> for NonZero<isize>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<u8>> for NonZero<u8>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<u16>> for NonZero<u16>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<u32>> for NonZero<u32>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<u64>> for NonZero<u64>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<u128>> for NonZero<u128>
where P: Part,

Source§

impl<P> FromUriParam<P, NonZero<usize>> for NonZero<usize>
where P: Part,

Source§

impl<T, A> FromUriParam<Query, Vec<A>> for Vec<T>

Source§

type Target = Vec<A>

Source§

fn from_uri_param(param: Vec<A>) -> Vec<A>

Source§

impl<T, A, const N: usize> FromUriParam<Query, [A; N]> for [T; N]

Source§

impl<T, A, const N: usize> FromUriParam<Query, [A; N]> for Vec<T>

Source§

impl<T, A, const N: usize> FromUriParam<Query, Vec<A>> for [T; N]

Source§

type Target = Vec<A>

Source§

fn from_uri_param(param: Vec<A>) -> Vec<A>

Implementors§

Source§

impl<'f, A, T: FromUriParam<Query, A> + FromForm<'f>> FromUriParam<Query, A> for Lenient<T>

Source§

impl<'f, A, T: FromUriParam<Query, A> + FromForm<'f>> FromUriParam<Query, A> for Strict<T>