Skip to main content

FromConfig

Trait FromConfig 

Source
pub trait FromConfig: Sized {
    // Required method
    fn from_config(
        property: &Property,
        ctx: &ConfigParseContext<'_>,
    ) -> ConfigResult<Self>;
}
Expand description

Parses a configuration Property into a target Rust type.

Required Methods§

Source

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Parses property using ctx.

§Parameters
  • property - Non-empty property selected by the reader.
  • ctx - Key, options, and substitution context.
§Returns

Parsed value, or a crate::ConfigError with key context.

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.

Implementations on Foreign Types§

Source§

impl FromConfig for Value

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for bool

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for char

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for f32

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for f64

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for i8

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for i16

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for i32

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for i64

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for i128

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for isize

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for u8

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for u16

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for u32

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for u64

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for u128

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for usize

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for String

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Parses property using ctx.

§Parameters
  • property - Non-empty property selected by the reader.
  • ctx - Key, options, and substitution context.
§Returns

Parsed value, or a crate::ConfigError with key context.

Source§

impl FromConfig for Duration

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for HashMap<String, String>

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for BigDecimal

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for DateTime<Utc>

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for NaiveDate

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for NaiveDateTime

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for NaiveTime

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for BigInt

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl FromConfig for Url

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Source§

impl<T> FromConfig for Vec<T>
where T: FromConfig,

Source§

fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>

Parses property using ctx.

§Parameters
  • property - Non-empty property selected by the reader.
  • ctx - Key, options, and substitution context.
§Returns

Parsed value, or a crate::ConfigError with key context.

Implementors§