Trait Param

Source
pub trait Param {
    type Output;

    // Required methods
    fn name(&self) -> &str;
    fn default(&self) -> Option<Self::Output>;
    fn extract(&self, raw: &str) -> Option<Self::Output>;
    fn serialize(&self, value: Self::Output) -> Option<String>;
}
Expand description

A type that transforms hash function parameters to and from the raw, serialized version.

Required Associated Types§

Source

type Output

The type of this parameter.

Required Methods§

Source

fn name(&self) -> &str

The parameter’s name.

Source

fn default(&self) -> Option<Self::Output>

The default value for the parameter if it isn’t included, or None if the parameter is required.

Source

fn extract(&self, raw: &str) -> Option<Self::Output>

Extract the parameter’s value from a serialized string, returning the value or None if parsing failed.

Source

fn serialize(&self, value: Self::Output) -> Option<String>

Serialize a value to a string.

Implementors§

Source§

impl<'a, T> Param for GenParam<'a, T>
where T: Clone + Display + FromStr + PartialEq,