[][src]Trait phc::Param

pub trait Param {
    type Output;
    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>; }

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

Associated Types

type Output

The type of this parameter.

Loading content...

Required methods

fn name(&self) -> &str

The parameter's name.

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

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

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.

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

Serialize a value to a string.

Loading content...

Implementors

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

type Output = T

Loading content...