Trait TryFromParam

Source
pub trait TryFromParam: Sized {
    // Required method
    fn try_from_param(param: &str) -> Option<Self>;
}
Expand description

Fallible conversion between a param capture into a value.

Implemented for all types that implement FromStr by default.

Required Methods§

Source

fn try_from_param(param: &str) -> Option<Self>

Creates a new value of this type from the given param. Returns None if the param cannot be converted into a value of this type.

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.

Implementors§

Source§

impl<T> TryFromParam for T
where T: FromStr,