Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
config_field in datafusion::common - Rust
[go: Go Back, main page]

Macro config_field

Source
macro_rules! config_field {
    ($t:ty) => { ... };
    ($t:ty, $arg:ident => $transform:expr) => { ... };
}
Expand description

Macro that generates ConfigField for a given type.

§Usage

This always requires Display to be implemented for the given type.

There are two ways to invoke this macro. The first one uses default_config_transform/FromStr to parse the data:

config_field(MyType);

Note that the parsing error MUST implement std::error::Error!

Or you can specify how you want to parse an str into the type:

fn parse_it(s: &str) -> Result<MyType> {
    ...
}

config_field(
    MyType,
    value => parse_it(value)
);