Trait mz_dyncfg::ConfigType

source ·
pub trait ConfigType:
    Into<ConfigVal>
    + Clone
    + Sized {
    // Required methods
    fn from_val(val: ConfigVal) -> Self;
    fn parse(s: &str) -> Result<Self, String>;
}
Expand description

A type usable as a Config.

Required Methods§

source

fn from_val(val: ConfigVal) -> Self

Converts a type-erased enum value to this type.

Panics if the enum’s variant does not match this type.

source

fn parse(s: &str) -> Result<Self, String>

Parses this string slice into a ConfigType.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ConfigType for Value

source§

fn from_val(val: ConfigVal) -> Self

source§

fn parse(s: &str) -> Result<Self, String>

source§

impl ConfigType for Option<usize>

source§

fn from_val(val: ConfigVal) -> Self

source§

fn parse(s: &str) -> Result<Self, String>

source§

impl ConfigType for bool

source§

fn from_val(val: ConfigVal) -> Self

source§

fn parse(s: &str) -> Result<Self, String>

source§

impl ConfigType for f64

source§

fn from_val(val: ConfigVal) -> Self

source§

fn parse(s: &str) -> Result<Self, String>

source§

impl ConfigType for u32

source§

fn from_val(val: ConfigVal) -> Self

source§

fn parse(s: &str) -> Result<Self, String>

source§

impl ConfigType for usize

source§

fn from_val(val: ConfigVal) -> Self

source§

fn parse(s: &str) -> Result<Self, String>

source§

impl ConfigType for String

source§

fn from_val(val: ConfigVal) -> Self

source§

fn parse(s: &str) -> Result<Self, String>

source§

impl ConfigType for Duration

source§

fn from_val(val: ConfigVal) -> Self

source§

fn parse(s: &str) -> Result<Self, String>

Implementors§