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§
Sourcefn from_config(
property: &Property,
ctx: &ConfigParseContext<'_>,
) -> ConfigResult<Self>
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
impl FromConfig for Value
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for bool
impl FromConfig for bool
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for char
impl FromConfig for char
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for f32
impl FromConfig for f32
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for f64
impl FromConfig for f64
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for i8
impl FromConfig for i8
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for i16
impl FromConfig for i16
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for i32
impl FromConfig for i32
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for i64
impl FromConfig for i64
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for i128
impl FromConfig for i128
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for isize
impl FromConfig for isize
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for u8
impl FromConfig for u8
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for u16
impl FromConfig for u16
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for u32
impl FromConfig for u32
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for u64
impl FromConfig for u64
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for u128
impl FromConfig for u128
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for usize
impl FromConfig for usize
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for String
impl FromConfig for String
Source§fn from_config(
property: &Property,
ctx: &ConfigParseContext<'_>,
) -> ConfigResult<Self>
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
impl FromConfig for Duration
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for HashMap<String, String>
impl FromConfig for HashMap<String, String>
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for BigDecimal
impl FromConfig for BigDecimal
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for DateTime<Utc>
impl FromConfig for DateTime<Utc>
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for NaiveDate
impl FromConfig for NaiveDate
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for NaiveDateTime
impl FromConfig for NaiveDateTime
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for NaiveTime
impl FromConfig for NaiveTime
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for BigInt
impl FromConfig for BigInt
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl FromConfig for Url
impl FromConfig for Url
fn from_config( property: &Property, ctx: &ConfigParseContext<'_>, ) -> ConfigResult<Self>
Source§impl<T> FromConfig for Vec<T>where
T: FromConfig,
impl<T> FromConfig for Vec<T>where
T: FromConfig,
Source§fn from_config(
property: &Property,
ctx: &ConfigParseContext<'_>,
) -> ConfigResult<Self>
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.