Skip to main content

PathParam

Trait PathParam 

Source
pub trait PathParam:
    Sealed
    + Sized
    + Send {
    // Required method
    fn parse_param(name: &str, raw: &str) -> Result<Self>;
}
Expand description

Types extractable from one path segment. The built-in set (integers, String, bool, floats, char) is sealed; custom param types (id newtypes) join it through the path_param! macro, which is the only sanctioned way to implement this trait outside the crate.

Required Methods§

Source

fn parse_param(name: &str, raw: &str) -> Result<Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PathParam for String

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for bool

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for char

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for f32

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for f64

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for i8

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for i16

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for i32

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for i64

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for i128

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for isize

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for u8

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for u16

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for u32

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for u64

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for u128

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Source§

impl PathParam for usize

Source§

fn parse_param(name: &str, raw: &str) -> Result<Self>

Implementors§